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
- ManifestResourceInfo.cs
- DateTimeFormatInfo.cs
- DataMemberFieldConverter.cs
- CodeGenerator.cs
- DiscreteKeyFrames.cs
- RectangleF.cs
- WebPartConnectionsConnectVerb.cs
- CodeObject.cs
- ChannelProtectionRequirements.cs
- AttributeUsageAttribute.cs
- Block.cs
- DocumentSchemaValidator.cs
- UrlPropertyAttribute.cs
- TextSyndicationContent.cs
- LayoutTableCell.cs
- CalendarDateRangeChangingEventArgs.cs
- PassportAuthenticationModule.cs
- FilterQuery.cs
- HttpResponseBase.cs
- DescendantQuery.cs
- WSDualHttpBindingElement.cs
- MailSettingsSection.cs
- BidOverLoads.cs
- PartialCachingAttribute.cs
- InstancePersistenceEvent.cs
- MSAAWinEventWrap.cs
- TimeoutConverter.cs
- RootCodeDomSerializer.cs
- SafeMILHandle.cs
- NativeRightsManagementAPIsStructures.cs
- RequestCachePolicyConverter.cs
- CompiledXpathExpr.cs
- RequiredFieldValidator.cs
- LinearKeyFrames.cs
- URLString.cs
- Sequence.cs
- InputBuffer.cs
- DataServiceKeyAttribute.cs
- DbResourceAllocator.cs
- AuthenticationModuleElementCollection.cs
- Comparer.cs
- SqlUtils.cs
- Label.cs
- CompilerTypeWithParams.cs
- Quad.cs
- WmlListAdapter.cs
- SQlBooleanStorage.cs
- ClientProxyGenerator.cs
- CodeStatementCollection.cs
- WebScriptClientGenerator.cs
- MultiBindingExpression.cs
- InvalidFilterCriteriaException.cs
- ReachSerializationCacheItems.cs
- InputScopeManager.cs
- ResourceProperty.cs
- XmlLanguage.cs
- SwitchDesigner.xaml.cs
- BamlLocalizableResource.cs
- TokenBasedSetEnumerator.cs
- FatalException.cs
- WebControlsSection.cs
- DropSource.cs
- CapabilitiesSection.cs
- WindowCollection.cs
- SecurityTimestamp.cs
- CacheModeValueSerializer.cs
- GradientBrush.cs
- EventSinkHelperWriter.cs
- GcHandle.cs
- IsolatedStorageFilePermission.cs
- ContractBase.cs
- TraceContext.cs
- RawStylusInputReport.cs
- MatrixAnimationUsingKeyFrames.cs
- AllMembershipCondition.cs
- DesignerActionGlyph.cs
- TraceSection.cs
- UserInitiatedNavigationPermission.cs
- CodeTypeDelegate.cs
- WindowsTreeView.cs
- PropagatorResult.cs
- HtmlElementEventArgs.cs
- ListenerConstants.cs
- UnknownBitmapEncoder.cs
- MenuStrip.cs
- OptimalBreakSession.cs
- EntityStoreSchemaGenerator.cs
- MSAAWinEventWrap.cs
- TextSelectionHighlightLayer.cs
- EventDescriptor.cs
- ComPlusAuthorization.cs
- RepeaterItem.cs
- DataGridColumnCollection.cs
- Msmq4SubqueuePoisonHandler.cs
- DebugHandleTracker.cs
- MenuItemCollectionEditor.cs
- OutputCacheModule.cs
- TreeWalkHelper.cs
- CompModSwitches.cs
- ExpressionPrefixAttribute.cs