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
- ValidatedControlConverter.cs
- LinearKeyFrames.cs
- HttpHandler.cs
- GroupAggregateExpr.cs
- TimeIntervalCollection.cs
- MostlySingletonList.cs
- TextWriter.cs
- RSAPKCS1SignatureFormatter.cs
- Constraint.cs
- WebPartCatalogAddVerb.cs
- ToolStripItemRenderEventArgs.cs
- JapaneseCalendar.cs
- cryptoapiTransform.cs
- BitmapSourceSafeMILHandle.cs
- IgnoreDataMemberAttribute.cs
- WindowsMenu.cs
- PcmConverter.cs
- CodeDOMProvider.cs
- ConfigurationErrorsException.cs
- ByteStack.cs
- SmtpMail.cs
- SrgsRule.cs
- CellIdBoolean.cs
- RoleManagerModule.cs
- AudioDeviceOut.cs
- StylusEventArgs.cs
- XmlSchemaImporter.cs
- InputScope.cs
- CancelRequestedRecord.cs
- StorageRoot.cs
- DeadCharTextComposition.cs
- MailDefinition.cs
- SQLDateTime.cs
- MsmqIntegrationSecurity.cs
- EdmFunction.cs
- CheckBoxFlatAdapter.cs
- LicenseContext.cs
- Schema.cs
- WebPartActionVerb.cs
- ComponentConverter.cs
- ProjectionPlanCompiler.cs
- PartialCachingAttribute.cs
- InvalidProgramException.cs
- Decoder.cs
- TraceUtility.cs
- OleDbConnectionFactory.cs
- IPGlobalProperties.cs
- NavigationEventArgs.cs
- ListQueryResults.cs
- RemotingConfigParser.cs
- SourceElementsCollection.cs
- TypedReference.cs
- MethodAccessException.cs
- EarlyBoundInfo.cs
- CqlQuery.cs
- SqlMetaData.cs
- OpCodes.cs
- TransactionException.cs
- FontUnit.cs
- BooleanToVisibilityConverter.cs
- OdbcPermission.cs
- SqlNodeTypeOperators.cs
- SplineKeyFrames.cs
- DataGridViewMethods.cs
- KeyEvent.cs
- XmlSchemaValidationException.cs
- ResXFileRef.cs
- DocumentApplicationJournalEntry.cs
- CacheChildrenQuery.cs
- StreamInfo.cs
- SendActivityDesigner.cs
- SymmetricKeyWrap.cs
- QueryStringHandler.cs
- RewritingValidator.cs
- WorkflowIdleBehavior.cs
- WinEventHandler.cs
- PopOutPanel.cs
- ProfileSection.cs
- TraceSection.cs
- XmlSerializableReader.cs
- GifBitmapDecoder.cs
- SoapExtensionStream.cs
- GradientBrush.cs
- ISessionStateStore.cs
- UInt32.cs
- BuiltInExpr.cs
- Int64.cs
- Point4D.cs
- FormsIdentity.cs
- ClientFormsIdentity.cs
- DataBinder.cs
- IntegerValidatorAttribute.cs
- FontSourceCollection.cs
- OperatingSystem.cs
- HighlightComponent.cs
- DiscoveryService.cs
- SiteOfOriginContainer.cs
- AuthorizationSection.cs
- _ConnectOverlappedAsyncResult.cs
- InvalidCastException.cs