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
- ObjectStateEntryDbUpdatableDataRecord.cs
- HoistedLocals.cs
- XmlConvert.cs
- BindingBase.cs
- InstanceHandleReference.cs
- BitmapEffectRenderDataResource.cs
- BaseCodePageEncoding.cs
- WindowsEditBoxRange.cs
- DataGridViewTextBoxColumn.cs
- UniqueIdentifierService.cs
- StrokeNodeData.cs
- XPathNavigatorReader.cs
- ResourceReader.cs
- path.cs
- DataGridViewTopRowAccessibleObject.cs
- MessageQueueInstaller.cs
- WindowsStartMenu.cs
- CompiledIdentityConstraint.cs
- ProjectionCamera.cs
- SafeHandle.cs
- ClientScriptManager.cs
- DependencyPropertyKey.cs
- DataGridViewRowStateChangedEventArgs.cs
- HttpWebRequest.cs
- DataGridViewSelectedCellsAccessibleObject.cs
- WebScriptClientGenerator.cs
- TypeDescriptorContext.cs
- TextAutomationPeer.cs
- ContextMenuStripActionList.cs
- ObjectViewFactory.cs
- IgnoreSection.cs
- ImplicitInputBrush.cs
- WriteStateInfoBase.cs
- FunctionParameter.cs
- DataGridViewCellMouseEventArgs.cs
- TrackingExtract.cs
- RuntimeWrappedException.cs
- XmlUtil.cs
- AdapterDictionary.cs
- PassportAuthenticationModule.cs
- VerificationAttribute.cs
- EntityClassGenerator.cs
- AdRotatorDesigner.cs
- SubclassTypeValidator.cs
- CalendarBlackoutDatesCollection.cs
- TraceHandlerErrorFormatter.cs
- SoapIgnoreAttribute.cs
- EventDescriptorCollection.cs
- WebPartCancelEventArgs.cs
- FileFormatException.cs
- TextEffect.cs
- EntityCommand.cs
- DataGridSortCommandEventArgs.cs
- XmlWhitespace.cs
- StrongNameMembershipCondition.cs
- BaseWebProxyFinder.cs
- DataSpaceManager.cs
- Rotation3DAnimationBase.cs
- CorrelationManager.cs
- EditorAttributeInfo.cs
- TextReader.cs
- DbParameterHelper.cs
- GlobalDataBindingHandler.cs
- SpellCheck.cs
- AudioSignalProblemOccurredEventArgs.cs
- PageAsyncTask.cs
- HttpModuleCollection.cs
- Directory.cs
- TableRow.cs
- JumpPath.cs
- compensatingcollection.cs
- GradientSpreadMethodValidation.cs
- WhitespaceReader.cs
- ProtocolsInstallComponent.cs
- PageContent.cs
- ImmComposition.cs
- Token.cs
- VectorAnimationBase.cs
- SQLConvert.cs
- RepeaterItem.cs
- CodeDirectoryCompiler.cs
- LineServicesRun.cs
- RuntimeVariablesExpression.cs
- ZipFileInfoCollection.cs
- Base64Encoder.cs
- SapiRecoContext.cs
- ContextDataSourceContextData.cs
- ErrorInfoXmlDocument.cs
- TextWriter.cs
- MsmqMessageProperty.cs
- sqlcontext.cs
- EntityDataSourceWrapper.cs
- ItemDragEvent.cs
- StyleConverter.cs
- MissingManifestResourceException.cs
- ColumnHeaderConverter.cs
- DataControlField.cs
- _emptywebproxy.cs
- LOSFormatter.cs
- BamlCollectionHolder.cs