Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / infocard / Client / System / IdentityModel / Selectors / InfoCardRSAPKCS1SignatureDeformatter.cs / 1305376 / InfoCardRSAPKCS1SignatureDeformatter.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.IdentityModel.Selectors { using System; using System.Security.Cryptography; internal class InfoCardRSAPKCS1SignatureDeformatter : 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 InfoCardRSAPKCS1SignatureDeformatter() : base() {} public InfoCardRSAPKCS1SignatureDeformatter( 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 InfoCardRSACryptoProvider ) { return ((InfoCardRSACryptoProvider) 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. //----------------------------------------------------------------------------- namespace System.IdentityModel.Selectors { using System; using System.Security.Cryptography; internal class InfoCardRSAPKCS1SignatureDeformatter : 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 InfoCardRSAPKCS1SignatureDeformatter() : base() {} public InfoCardRSAPKCS1SignatureDeformatter( 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 InfoCardRSACryptoProvider ) { return ((InfoCardRSACryptoProvider) m_rsaKey).VerifyHash(rgbHash, m_strOID, rgbSignature); } else { return base.VerifySignature( rgbHash, rgbSignature ); } } } } // 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
- RangeValueProviderWrapper.cs
- MenuItemStyleCollection.cs
- ApplicationFileCodeDomTreeGenerator.cs
- NativeActivity.cs
- WebPartsPersonalizationAuthorization.cs
- CodeDirectiveCollection.cs
- BuildProvider.cs
- Object.cs
- RoutingExtensionElement.cs
- HttpResponseInternalWrapper.cs
- CompilerError.cs
- MsmqBindingBase.cs
- QilTernary.cs
- PointHitTestResult.cs
- ConfigurationSettings.cs
- IdentityValidationException.cs
- PropertyEmitter.cs
- ProgressBarHighlightConverter.cs
- MsmqBindingFilter.cs
- IncrementalHitTester.cs
- ErrorHandlerFaultInfo.cs
- CommunicationException.cs
- EdmEntityTypeAttribute.cs
- ValidatingPropertiesEventArgs.cs
- DependencyPropertyChangedEventArgs.cs
- ColorConvertedBitmap.cs
- DetailsViewInsertedEventArgs.cs
- ObjectDataSourceSelectingEventArgs.cs
- StrokeIntersection.cs
- sqlmetadatafactory.cs
- SubpageParagraph.cs
- LinkArea.cs
- NetworkCredential.cs
- XmlFormatExtensionPointAttribute.cs
- CustomAttributeFormatException.cs
- IIS7UserPrincipal.cs
- xml.cs
- IsolatedStorageFile.cs
- DataShape.cs
- ListViewCancelEventArgs.cs
- AnimationStorage.cs
- RequestSecurityTokenSerializer.cs
- SizeChangedInfo.cs
- TextChange.cs
- Attributes.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- EventArgs.cs
- SmiRequestExecutor.cs
- BaseDataBoundControlDesigner.cs
- Typeface.cs
- DataGridViewIntLinkedList.cs
- BitmapVisualManager.cs
- FixedSOMTextRun.cs
- LicenseException.cs
- ExpandSegment.cs
- SqlConnectionHelper.cs
- dataprotectionpermissionattribute.cs
- CheckableControlBaseAdapter.cs
- HttpApplication.cs
- RootBuilder.cs
- LinkClickEvent.cs
- CodeMethodInvokeExpression.cs
- Command.cs
- PaintEvent.cs
- Ppl.cs
- ArrayElementGridEntry.cs
- WorkflowRuntimeServiceElementCollection.cs
- PropertyRecord.cs
- PropertiesTab.cs
- RequestBringIntoViewEventArgs.cs
- FullTextBreakpoint.cs
- OleDbCommandBuilder.cs
- HtmlTable.cs
- CheckBoxStandardAdapter.cs
- SQLDateTimeStorage.cs
- TransportDefaults.cs
- RawTextInputReport.cs
- Compiler.cs
- ConfigurationConverterBase.cs
- JsonFormatGeneratorStatics.cs
- StructuredType.cs
- ExpandCollapsePatternIdentifiers.cs
- namescope.cs
- _SingleItemRequestCache.cs
- DiscoveryReferences.cs
- CatalogPart.cs
- SimpleHandlerFactory.cs
- EdmFunctions.cs
- SecurityHeaderLayout.cs
- VolatileResourceManager.cs
- SettingsPropertyWrongTypeException.cs
- TableItemStyle.cs
- UshortList2.cs
- TextDecoration.cs
- TablePattern.cs
- NativeDirectoryServicesQueryAPIs.cs
- EventRoute.cs
- IDictionary.cs
- CatalogPart.cs
- StringToken.cs