Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / IdentityModel / System / IdentityModel / Tokens / X509ThumbprintKeyIdentifierClause.cs / 1305376 / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TextBoxLine.cs
- DbDataRecord.cs
- PolygonHotSpot.cs
- ImageListStreamer.cs
- UserUseLicenseDictionaryLoader.cs
- ReadOnlyActivityGlyph.cs
- TimelineGroup.cs
- KeyGesture.cs
- Win32PrintDialog.cs
- BoundColumn.cs
- AttributeAction.cs
- Matrix3DValueSerializer.cs
- ObjectDataSourceDesigner.cs
- ResourceExpressionBuilder.cs
- altserialization.cs
- PointValueSerializer.cs
- HtmlGenericControl.cs
- TreeBuilder.cs
- ConfigurationException.cs
- BitmapEffect.cs
- Int32CAMarshaler.cs
- DateTimeUtil.cs
- EntityDataSourceState.cs
- DataProtection.cs
- VirtualizingPanel.cs
- FrameworkElementAutomationPeer.cs
- DataListGeneralPage.cs
- ProgressBar.cs
- VsPropertyGrid.cs
- ConfigurationLoader.cs
- UrlAuthorizationModule.cs
- PtsHost.cs
- SqlProviderManifest.cs
- AssemblyName.cs
- VariableQuery.cs
- RSAOAEPKeyExchangeDeformatter.cs
- RemoteWebConfigurationHostServer.cs
- ZeroOpNode.cs
- EngineSite.cs
- NamedObject.cs
- _FixedSizeReader.cs
- IriParsingElement.cs
- IgnoreFileBuildProvider.cs
- ConversionContext.cs
- StatusBarItem.cs
- TextBounds.cs
- AsyncDataRequest.cs
- FormatConvertedBitmap.cs
- ExtentKey.cs
- TextComposition.cs
- HeaderedItemsControl.cs
- IndexerNameAttribute.cs
- RegexCapture.cs
- XmlIterators.cs
- BitmapEffectDrawingContent.cs
- InfoCardRSAOAEPKeyExchangeDeformatter.cs
- QilLoop.cs
- SqlGenerator.cs
- StackBuilderSink.cs
- ListItemParagraph.cs
- EnumType.cs
- WindowsSlider.cs
- XamlVector3DCollectionSerializer.cs
- PropertyEmitterBase.cs
- Expression.cs
- DesignTimeParseData.cs
- FSWPathEditor.cs
- ObjectItemAttributeAssemblyLoader.cs
- CellNormalizer.cs
- filewebrequest.cs
- DataViewSettingCollection.cs
- HtmlTitle.cs
- Decoder.cs
- EventlogProvider.cs
- Tokenizer.cs
- EndEvent.cs
- InvokeBase.cs
- MessageDesigner.cs
- WinInet.cs
- OracleConnectionFactory.cs
- PermissionSet.cs
- MdImport.cs
- ViewValidator.cs
- ChangePassword.cs
- Delegate.cs
- _ProxyChain.cs
- CodeDefaultValueExpression.cs
- ScalarConstant.cs
- WSMessageEncoding.cs
- SoapMessage.cs
- DataTableNameHandler.cs
- UiaCoreProviderApi.cs
- UrlPath.cs
- DbConnectionClosed.cs
- LifetimeManager.cs
- Dump.cs
- FormsAuthenticationCredentials.cs
- Interlocked.cs
- AppSettings.cs
- PreviewPageInfo.cs