Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / IdentityModel / System / IdentityModel / Tokens / X509RawDataKeyIdentifierClause.cs / 1305376 / X509RawDataKeyIdentifierClause.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.IdentityModel.Tokens { using System.Globalization; using System.Security.Cryptography.X509Certificates; public class X509RawDataKeyIdentifierClause : BinaryKeyIdentifierClause { X509Certificate2 certificate; X509AsymmetricSecurityKey key; public X509RawDataKeyIdentifierClause(X509Certificate2 certificate) : this(GetRawData(certificate), false) { this.certificate = certificate; } public X509RawDataKeyIdentifierClause(byte[] certificateRawData) : this(certificateRawData, true) { } internal X509RawDataKeyIdentifierClause(byte[] certificateRawData, bool cloneBuffer) : base(null, certificateRawData, cloneBuffer) { } public override bool CanCreateKey { get { return true; } } public override SecurityKey CreateKey() { if (this.key == null) { if (this.certificate == null) { this.certificate = new X509Certificate2(GetBuffer()); } this.key = new X509AsymmetricSecurityKey(this.certificate); } return this.key; } static byte[] GetRawData(X509Certificate certificate) { if (certificate == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("certificate"); return certificate.GetRawCertData(); } public byte[] GetX509RawData() { return GetBuffer(); } public bool Matches(X509Certificate2 certificate) { if (certificate == null) return false; return Matches(GetRawData(certificate)); } public override string ToString() { return string.Format(CultureInfo.InvariantCulture, "X509RawDataKeyIdentifierClause(RawData = {0})", ToBase64String()); } } } // 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
- DateTimeUtil.cs
- RegexGroup.cs
- DynamicRouteExpression.cs
- PropertyMap.cs
- OperationInvokerBehavior.cs
- XamlParser.cs
- UserControl.cs
- ProfileSettings.cs
- WindowsStatic.cs
- XamlInt32CollectionSerializer.cs
- MatrixStack.cs
- TextProviderWrapper.cs
- RepeatBehavior.cs
- LockRenewalTask.cs
- MaterialGroup.cs
- Delegate.cs
- EventHandlerList.cs
- IndicCharClassifier.cs
- ButtonFieldBase.cs
- DataShape.cs
- CommandValueSerializer.cs
- DesignerUtility.cs
- XmlProcessingInstruction.cs
- TabletCollection.cs
- ParseNumbers.cs
- HtmlValidatorAdapter.cs
- HandleCollector.cs
- SiteMapPath.cs
- TextRunTypographyProperties.cs
- DataRecordInfo.cs
- SecurityBindingElement.cs
- PersistNameAttribute.cs
- Dispatcher.cs
- TextDecorationCollection.cs
- ZoomComboBox.cs
- ReadOnlyAttribute.cs
- TextElementEditingBehaviorAttribute.cs
- UInt16Storage.cs
- UnionCodeGroup.cs
- CodeGenerator.cs
- TransactionFormatter.cs
- ThrowHelper.cs
- ResourceReferenceExpressionConverter.cs
- EntityClientCacheKey.cs
- TreeChangeInfo.cs
- VolatileEnlistmentState.cs
- DefaultExpression.cs
- FocusWithinProperty.cs
- itemelement.cs
- SqlGatherProducedAliases.cs
- ExceptionRoutedEventArgs.cs
- MetadataAssemblyHelper.cs
- CheckableControlBaseAdapter.cs
- SoapSchemaImporter.cs
- ControlEvent.cs
- OleDbFactory.cs
- CrossSiteScriptingValidation.cs
- indexingfiltermarshaler.cs
- BitConverter.cs
- CopyAction.cs
- SchemaTableOptionalColumn.cs
- SiteMapPath.cs
- NameValueFileSectionHandler.cs
- DataGridBoolColumn.cs
- Model3DGroup.cs
- PageStatePersister.cs
- NumericUpDownAccelerationCollection.cs
- InfoCardSymmetricAlgorithm.cs
- SQLMoneyStorage.cs
- SmiEventStream.cs
- WindowsTooltip.cs
- LoginCancelEventArgs.cs
- ReflectTypeDescriptionProvider.cs
- DataGridViewCellCollection.cs
- UpdateRecord.cs
- XmlWriter.cs
- BasicViewGenerator.cs
- EntityDesignerDataSourceView.cs
- PackageFilter.cs
- HttpContext.cs
- DerivedKeySecurityToken.cs
- ProxyGenerator.cs
- ItemsPanelTemplate.cs
- SslStream.cs
- XPathNodeInfoAtom.cs
- GridViewColumnCollection.cs
- CustomErrorsSectionWrapper.cs
- MissingMethodException.cs
- RowsCopiedEventArgs.cs
- TableCellAutomationPeer.cs
- OleDbException.cs
- CodeGen.cs
- CodeGroup.cs
- SqlStream.cs
- HtmlContainerControl.cs
- CollectionConverter.cs
- XmlILAnnotation.cs
- WebBrowserNavigatingEventHandler.cs
- RegexCompiler.cs
- SymbolMethod.cs