Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / infocard / Service / managed / Microsoft / InfoCards / SelfIssuedAuthRSAPKCS1SignatureDeformatter.cs / 1 / SelfIssuedAuthRSAPKCS1SignatureDeformatter.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- // namespace Microsoft.InfoCards { using System; using System.IdentityModel.Selectors; using System.IdentityModel.Tokens; using System.ServiceModel; using System.ServiceModel.Security; using System.ServiceModel.Security.Tokens; using System.Runtime.InteropServices; using System.Security.Cryptography; using System.IdentityModel; using System.Security.Cryptography.Xml; using IDT = Microsoft.InfoCards.Diagnostics.InfoCardTrace; using System.Collections.ObjectModel; using System.Collections.Generic; // // Summary: // This class implements the mechanism to call SelfIssuedAuthRSACryptoProvider's VerifyHash // internal class SelfIssuedAuthRSAPKCS1SignatureDeformatter : RSAPKCS1SignatureDeformatter { private RSA m_rsaKey; // RSA Key value to do decrypt operation private string m_strOID; // OID value for the HASH algorithm // // public constructors // public SelfIssuedAuthRSAPKCS1SignatureDeformatter() : base() { } public SelfIssuedAuthRSAPKCS1SignatureDeformatter( AsymmetricAlgorithm key ) : base( key ) { m_rsaKey = ( RSA )key; } // // public methods // public override void SetKey( AsymmetricAlgorithm key ) { base.SetKey( key ); m_rsaKey = ( RSA )key; } public override void SetHashAlgorithm( string strName ) { base.SetHashAlgorithm( strName ); m_strOID = CryptoConfig.MapNameToOID( strName ); } public override bool VerifySignature( byte[ ] rgbHash, byte[ ] rgbSignature ) { if ( !( m_strOID == null || m_rsaKey == null || rgbHash == null || rgbSignature == null ) && m_rsaKey is SelfIssuedAuthRSACryptoProvider ) { return ( ( SelfIssuedAuthRSACryptoProvider )m_rsaKey ).VerifyHash( rgbHash, m_strOID, rgbSignature ); } else { return base.VerifySignature( rgbHash, rgbSignature ); } } } } // 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
- ExpressionBinding.cs
- BlurEffect.cs
- CancellableEnumerable.cs
- DetailsViewDeletedEventArgs.cs
- InternalMappingException.cs
- TextModifier.cs
- ImmutableClientRuntime.cs
- NetPeerTcpBinding.cs
- TransformerTypeCollection.cs
- XmlElement.cs
- TakeQueryOptionExpression.cs
- CapabilitiesPattern.cs
- DynamicResourceExtension.cs
- QueryStringParameter.cs
- TextSpan.cs
- XPathArrayIterator.cs
- ControlIdConverter.cs
- DispatcherObject.cs
- SRDisplayNameAttribute.cs
- SqlConnectionHelper.cs
- JpegBitmapDecoder.cs
- CqlWriter.cs
- XmlWriter.cs
- ParentUndoUnit.cs
- DataGridViewRowPrePaintEventArgs.cs
- PresentationSource.cs
- ByteStreamGeometryContext.cs
- Triplet.cs
- WebPartCatalogCloseVerb.cs
- DeflateStream.cs
- ConnectionManager.cs
- TextTreeObjectNode.cs
- TypeConstant.cs
- Point3DCollection.cs
- PeerChannelListener.cs
- StorageEntityContainerMapping.cs
- HandlerWithFactory.cs
- XmlSchemaSimpleContent.cs
- VisualStyleInformation.cs
- CheckPair.cs
- DtrList.cs
- ClientType.cs
- oledbmetadatacollectionnames.cs
- HtmlInputRadioButton.cs
- ExpressionValueEditor.cs
- Style.cs
- ObjectDisposedException.cs
- DataGridDetailsPresenterAutomationPeer.cs
- OracleLob.cs
- ChangeTracker.cs
- PageThemeParser.cs
- Serializer.cs
- HttpFileCollection.cs
- XmlSchemaAnnotation.cs
- BuildProvider.cs
- InputReportEventArgs.cs
- serverconfig.cs
- PerfProviderCollection.cs
- StructureChangedEventArgs.cs
- SqlException.cs
- UseAttributeSetsAction.cs
- UpnEndpointIdentity.cs
- LineMetrics.cs
- sapiproxy.cs
- XmlnsDictionary.cs
- COAUTHIDENTITY.cs
- EmissiveMaterial.cs
- IndexedString.cs
- ContextDataSourceContextData.cs
- UInt32Storage.cs
- FormViewCommandEventArgs.cs
- SubMenuStyleCollection.cs
- EnumValidator.cs
- XmlSerializer.cs
- JobInputBins.cs
- Select.cs
- StrongNameKeyPair.cs
- HttpClientCertificate.cs
- RegexRunner.cs
- ServiceReference.cs
- DataGridViewComboBoxCell.cs
- XmlComment.cs
- dbenumerator.cs
- WindowCollection.cs
- SqlServer2KCompatibilityCheck.cs
- GifBitmapDecoder.cs
- ParsedRoute.cs
- arabicshape.cs
- XmlParserContext.cs
- AnnotationDocumentPaginator.cs
- NameScopePropertyAttribute.cs
- embossbitmapeffect.cs
- SelectionUIHandler.cs
- FileLogRecordHeader.cs
- CreateRefExpr.cs
- DataGridPageChangedEventArgs.cs
- PrintPageEvent.cs
- WebEventTraceProvider.cs
- HyperlinkAutomationPeer.cs
- DBSchemaTable.cs