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
- ItemsControl.cs
- WebPartZone.cs
- ToolStripItemRenderEventArgs.cs
- PropertyConverter.cs
- SetMemberBinder.cs
- KeyGestureValueSerializer.cs
- DataComponentMethodGenerator.cs
- ArgumentNullException.cs
- ResXResourceReader.cs
- XmlSiteMapProvider.cs
- SqlProfileProvider.cs
- TypeSystem.cs
- DataGridColumnHeaderItemAutomationPeer.cs
- PagePropertiesChangingEventArgs.cs
- BooleanProjectedSlot.cs
- XamlPathDataSerializer.cs
- SR.cs
- GridViewColumnHeaderAutomationPeer.cs
- AesCryptoServiceProvider.cs
- SplitContainer.cs
- FormViewPageEventArgs.cs
- IndicShape.cs
- AttachedPropertyMethodSelector.cs
- TargetException.cs
- ChangeNode.cs
- XD.cs
- SoapObjectInfo.cs
- ExtensionSimplifierMarkupObject.cs
- _ConnectionGroup.cs
- TripleDES.cs
- Decorator.cs
- BitmapImage.cs
- ProxyGenerationError.cs
- CodeEntryPointMethod.cs
- XmlArrayItemAttribute.cs
- DataGridItem.cs
- ReadOnlyDictionary.cs
- UDPClient.cs
- WebControl.cs
- PropertyEmitterBase.cs
- EnumerableCollectionView.cs
- CssStyleCollection.cs
- TextComposition.cs
- HeaderLabel.cs
- PropagationProtocolsTracing.cs
- CellRelation.cs
- TransactionChannelFactory.cs
- CompensatableTransactionScopeActivityDesigner.cs
- Visual.cs
- RegisteredScript.cs
- BridgeDataRecord.cs
- BitmapEffectInputData.cs
- UncommonField.cs
- BaseDataList.cs
- NonSerializedAttribute.cs
- DataGridCommandEventArgs.cs
- ClipboardProcessor.cs
- MorphHelpers.cs
- WebPartHelpVerb.cs
- InvalidEnumArgumentException.cs
- SqlConnectionHelper.cs
- BorderGapMaskConverter.cs
- UIElementParagraph.cs
- DiagnosticTraceSchemas.cs
- MemoryRecordBuffer.cs
- SpecularMaterial.cs
- TreeView.cs
- _AutoWebProxyScriptEngine.cs
- EventDescriptorCollection.cs
- ChangeInterceptorAttribute.cs
- StackOverflowException.cs
- ConsumerConnectionPoint.cs
- TryLoadRunnableWorkflowCommand.cs
- RequestBringIntoViewEventArgs.cs
- SqlConnectionManager.cs
- ServiceModelExtensionCollectionElement.cs
- WebServiceAttribute.cs
- SharedConnectionWorkflowTransactionService.cs
- TableLayoutCellPaintEventArgs.cs
- WebPartDeleteVerb.cs
- ApplicationInfo.cs
- ConstructorArgumentAttribute.cs
- ContextProperty.cs
- SessionState.cs
- NavigationProperty.cs
- DynamicRouteExpression.cs
- ChannelRequirements.cs
- ComponentChangedEvent.cs
- ExtensionFile.cs
- Point4DConverter.cs
- OrderPreservingSpoolingTask.cs
- ReferenceCountedObject.cs
- Clipboard.cs
- DbException.cs
- securitycriticaldataformultiplegetandset.cs
- OrthographicCamera.cs
- SecurityPolicySection.cs
- DodSequenceMerge.cs
- EmbeddedMailObject.cs
- KnownTypes.cs