Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Security / X509CertificateInitiatorClientCredential.cs / 1 / X509CertificateInitiatorClientCredential.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.ServiceModel.Security { using System.Security.Cryptography.X509Certificates; using System.ServiceModel; public sealed class X509CertificateInitiatorClientCredential { internal const StoreLocation DefaultStoreLocation = StoreLocation.CurrentUser; internal const StoreName DefaultStoreName = StoreName.My; internal const X509FindType DefaultFindType = X509FindType.FindBySubjectDistinguishedName; X509Certificate2 certificate; bool isReadOnly; internal X509CertificateInitiatorClientCredential() { // empty } internal X509CertificateInitiatorClientCredential(X509CertificateInitiatorClientCredential other) { this.certificate = other.certificate; this.isReadOnly = other.isReadOnly; } public X509Certificate2 Certificate { get { return this.certificate; } set { ThrowIfImmutable(); this.certificate = value; } } public void SetCertificate(string subjectName, StoreLocation storeLocation, StoreName storeName) { if (subjectName == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("subjectName"); } SetCertificate(storeLocation, storeName, DefaultFindType, subjectName); } public void SetCertificate(StoreLocation storeLocation, StoreName storeName, X509FindType findType, object findValue) { if (findValue == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("findValue"); } ThrowIfImmutable(); this.certificate = SecurityUtils.GetCertificateFromStore(storeName, storeLocation, findType, findValue, null); } internal void MakeReadOnly() { this.isReadOnly = true; } void ThrowIfImmutable() { if (this.isReadOnly) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.ObjectIsReadOnly))); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- log.cs
- IPipelineRuntime.cs
- coordinatorscratchpad.cs
- AncestorChangedEventArgs.cs
- PropertyToken.cs
- SslStream.cs
- UntypedNullExpression.cs
- DashStyle.cs
- Menu.cs
- ObjectContext.cs
- IOThreadTimer.cs
- NumberSubstitution.cs
- DocumentViewer.cs
- ReaderContextStackData.cs
- WindowsSolidBrush.cs
- ApplicationFileParser.cs
- EtwProvider.cs
- CacheEntry.cs
- ThreadStaticAttribute.cs
- DragSelectionMessageFilter.cs
- CoTaskMemHandle.cs
- StylusPointPropertyUnit.cs
- _ProxyChain.cs
- Int64Storage.cs
- XhtmlCssHandler.cs
- SoapElementAttribute.cs
- AddInToken.cs
- EventMappingSettingsCollection.cs
- BinaryExpressionHelper.cs
- RefreshEventArgs.cs
- DeclaredTypeElement.cs
- MaterializeFromAtom.cs
- HttpProfileGroupBase.cs
- XmlWriter.cs
- PermissionRequestEvidence.cs
- MenuItemBindingCollection.cs
- DSASignatureDeformatter.cs
- EntryIndex.cs
- WizardStepBase.cs
- Menu.cs
- Message.cs
- WebPartConnectionsEventArgs.cs
- SendSecurityHeader.cs
- PropertyNames.cs
- SplineKeyFrames.cs
- Vector3D.cs
- SelectionListComponentEditor.cs
- XmlElementCollection.cs
- TextContainerChangedEventArgs.cs
- SqlDataSourceSelectingEventArgs.cs
- OletxTransactionFormatter.cs
- JournalNavigationScope.cs
- Utilities.cs
- HtmlProps.cs
- ScriptBehaviorDescriptor.cs
- EndpointConfigContainer.cs
- XmlAttributeAttribute.cs
- PropertyGroupDescription.cs
- ProcessHost.cs
- GraphicsPathIterator.cs
- ComplusTypeValidator.cs
- RSAPKCS1SignatureDeformatter.cs
- COM2EnumConverter.cs
- DbParameterCollectionHelper.cs
- ConsoleCancelEventArgs.cs
- GreenMethods.cs
- ChannelEndpointElement.cs
- CommandPlan.cs
- XmlCustomFormatter.cs
- _RequestCacheProtocol.cs
- DbExpressionRules.cs
- IndexOutOfRangeException.cs
- EntityDataSourceDesignerHelper.cs
- PkcsUtils.cs
- DotAtomReader.cs
- TextDocumentView.cs
- Document.cs
- SoapDocumentServiceAttribute.cs
- OutOfMemoryException.cs
- SessionParameter.cs
- WindowsAuthenticationModule.cs
- UIElementHelper.cs
- MarshalByValueComponent.cs
- RepeatButtonAutomationPeer.cs
- TextChangedEventArgs.cs
- ExpressionBuilderCollection.cs
- CounterSampleCalculator.cs
- TextDecorationCollection.cs
- _PooledStream.cs
- InheritanceContextChangedEventManager.cs
- StyleTypedPropertyAttribute.cs
- ArrayList.cs
- ChildDocumentBlock.cs
- HostVisual.cs
- Int32CAMarshaler.cs
- StreamGeometry.cs
- TabItem.cs
- EllipticalNodeOperations.cs
- CodeVariableReferenceExpression.cs
- HttpWriter.cs