Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / IdentityModel / System / IdentityModel / Tokens / X509ThumbprintKeyIdentifierClause.cs / 1 / X509ThumbprintKeyIdentifierClause.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.IdentityModel.Tokens { using System.Globalization; using System.Security.Cryptography.X509Certificates; public class X509ThumbprintKeyIdentifierClause : BinaryKeyIdentifierClause { public X509ThumbprintKeyIdentifierClause(X509Certificate2 certificate) : this(GetHash(certificate), false) { } public X509ThumbprintKeyIdentifierClause(byte[] thumbprint) : this(thumbprint, true) { } internal X509ThumbprintKeyIdentifierClause(byte[] thumbprint, bool cloneBuffer) : base(null, thumbprint, cloneBuffer) { } static byte[] GetHash(X509Certificate2 certificate) { if (certificate == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("certificate"); return certificate.GetCertHash(); } public byte[] GetX509Thumbprint() { return GetBuffer(); } public bool Matches(X509Certificate2 certificate) { if (certificate == null) return false; return Matches(GetHash(certificate)); } public override string ToString() { return string.Format(CultureInfo.InvariantCulture, "X509ThumbprintKeyIdentifierClause(Hash = 0x{0})", ToHexString()); } } } // 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
- GPStream.cs
- OleDbReferenceCollection.cs
- FatalException.cs
- OutputCacheModule.cs
- CommentEmitter.cs
- ObjectKeyFrameCollection.cs
- SingletonConnectionReader.cs
- BindableAttribute.cs
- RequiredAttributeAttribute.cs
- WebReferenceOptions.cs
- AVElementHelper.cs
- TextFormatterContext.cs
- Message.cs
- prompt.cs
- PermissionListSet.cs
- LoginView.cs
- RestHandler.cs
- Int32CAMarshaler.cs
- MouseEvent.cs
- SecurityDocument.cs
- KnownTypesProvider.cs
- DateTimeOffsetStorage.cs
- ScrollChangedEventArgs.cs
- ReadOnlyNameValueCollection.cs
- DbProviderSpecificTypePropertyAttribute.cs
- ItemList.cs
- ResumeStoryboard.cs
- NavigationPropertySingletonExpression.cs
- MultiTargetingUtil.cs
- safex509handles.cs
- DesignerProperties.cs
- TextFormattingConverter.cs
- CodeConditionStatement.cs
- Stack.cs
- _NtlmClient.cs
- ProfileSettingsCollection.cs
- Calendar.cs
- DNS.cs
- Rule.cs
- HttpListenerPrefixCollection.cs
- UIElement3D.cs
- DataGridViewElement.cs
- BindingValueChangedEventArgs.cs
- XmlWhitespace.cs
- BindingListCollectionView.cs
- GraphicsPath.cs
- ObjectDataSourceMethodEventArgs.cs
- WindowsListBox.cs
- Viewport3DVisual.cs
- RequestCachingSection.cs
- Encoding.cs
- HashAlgorithm.cs
- _ProxyChain.cs
- KeyFrames.cs
- PenContexts.cs
- UnsafeNativeMethods.cs
- SqlEnums.cs
- SharedStatics.cs
- GridLength.cs
- DbFunctionCommandTree.cs
- XmlSchemaSimpleType.cs
- XmlValidatingReader.cs
- TemplateBindingExtension.cs
- WriteableOnDemandPackagePart.cs
- SafeProcessHandle.cs
- FilteredAttributeCollection.cs
- ColorTransformHelper.cs
- EntityCollection.cs
- FormViewAutoFormat.cs
- WhitespaceReader.cs
- BindingFormattingDialog.cs
- StretchValidation.cs
- StyleSelector.cs
- PersonalizationStateInfoCollection.cs
- DataControlPagerLinkButton.cs
- OleDbFactory.cs
- TreeNode.cs
- SecurityResources.cs
- RenderContext.cs
- PageAsyncTask.cs
- JsonXmlDataContract.cs
- ItemsControlAutomationPeer.cs
- ProgressChangedEventArgs.cs
- DocumentViewerHelper.cs
- BinaryHeap.cs
- XmlSchemaComplexContentExtension.cs
- SerializationObjectManager.cs
- Profiler.cs
- NonDualMessageSecurityOverHttpElement.cs
- VisualTreeUtils.cs
- DateTimePickerDesigner.cs
- DictionaryBase.cs
- WorkflowViewStateService.cs
- GridSplitterAutomationPeer.cs
- HitTestDrawingContextWalker.cs
- Encoding.cs
- XamlParser.cs
- XmlSerializerVersionAttribute.cs
- ResolveNameEventArgs.cs
- Repeater.cs