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
- FlowDocument.cs
- FileSystemInfo.cs
- ScriptingAuthenticationServiceSection.cs
- ClickablePoint.cs
- DataRowComparer.cs
- KeySplineConverter.cs
- ObjectCache.cs
- KeyPullup.cs
- UnmanagedMemoryStreamWrapper.cs
- SQLRoleProvider.cs
- RemotingException.cs
- ListenerUnsafeNativeMethods.cs
- TypedReference.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- EntityTypeEmitter.cs
- XmlSchemaCompilationSettings.cs
- HttpValueCollection.cs
- PriorityBindingExpression.cs
- WsdlInspector.cs
- RoleManagerSection.cs
- TracedNativeMethods.cs
- ClickablePoint.cs
- ResourceManagerWrapper.cs
- HttpPostedFile.cs
- Properties.cs
- BulletedListEventArgs.cs
- CompositeKey.cs
- figurelengthconverter.cs
- DockProviderWrapper.cs
- messageonlyhwndwrapper.cs
- TextServicesPropertyRanges.cs
- IPEndPointCollection.cs
- ProbeDuplexCD1AsyncResult.cs
- CutCopyPasteHelper.cs
- WorkflowViewElement.cs
- InvalidDocumentContentsException.cs
- FactoryMaker.cs
- ListControl.cs
- XmlSignatureProperties.cs
- HandlerFactoryWrapper.cs
- EnumBuilder.cs
- CompositeControlDesigner.cs
- Point3DConverter.cs
- TextRangeSerialization.cs
- VisualStyleTypesAndProperties.cs
- SqlClientWrapperSmiStream.cs
- MappingModelBuildProvider.cs
- Invariant.cs
- CellConstant.cs
- MsmqIntegrationOutputChannel.cs
- SQLInt64.cs
- StyleXamlParser.cs
- MdiWindowListStrip.cs
- VersionedStreamOwner.cs
- BuildProvider.cs
- DataGridViewComboBoxColumn.cs
- BooleanAnimationUsingKeyFrames.cs
- DataRecordInternal.cs
- SizeChangedInfo.cs
- PngBitmapEncoder.cs
- TypeRefElement.cs
- Assert.cs
- Mapping.cs
- VisualStyleRenderer.cs
- GridProviderWrapper.cs
- AutoCompleteStringCollection.cs
- DeflateStream.cs
- OpenFileDialog.cs
- BitmapEffectDrawingContextState.cs
- TdsParserStateObject.cs
- SafeHandles.cs
- SqlCommandSet.cs
- PartialTrustVisibleAssembly.cs
- RenderDataDrawingContext.cs
- GCHandleCookieTable.cs
- Stopwatch.cs
- CheckBoxFlatAdapter.cs
- ApplicationFileParser.cs
- EntityDataSourceDataSelection.cs
- StreamingContext.cs
- EmptyCollection.cs
- ConfigurationManager.cs
- FunctionQuery.cs
- SchemaImporterExtensionElementCollection.cs
- BindingMemberInfo.cs
- WebPartConnectionsCancelEventArgs.cs
- HandlerBase.cs
- SafeWaitHandle.cs
- OdbcParameter.cs
- WindowsFormsHost.cs
- CodeDirectiveCollection.cs
- DateTimeValueSerializerContext.cs
- ImageDrawing.cs
- SystemInformation.cs
- WebPartConnectionsConnectVerb.cs
- LayoutInformation.cs
- ExpressionEditorSheet.cs
- ImportOptions.cs
- CounterSampleCalculator.cs
- NamespaceQuery.cs