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
- EnterpriseServicesHelper.cs
- StorageAssociationTypeMapping.cs
- XslVisitor.cs
- PieceDirectory.cs
- MetadataArtifactLoaderCompositeFile.cs
- ServiceContractViewControl.Designer.cs
- WeakReferenceList.cs
- SerialStream.cs
- HtmlInputText.cs
- counter.cs
- HandleCollector.cs
- RecordManager.cs
- Crypto.cs
- RTLAwareMessageBox.cs
- StrokeCollection.cs
- ResourceManagerWrapper.cs
- MessageProperties.cs
- cookiecollection.cs
- ScriptHandlerFactory.cs
- CompensatableTransactionScopeActivity.cs
- GridViewSelectEventArgs.cs
- BuildManager.cs
- ScriptManager.cs
- RelationHandler.cs
- Flowchart.cs
- PropertyPathConverter.cs
- DataSourceView.cs
- ValidationEventArgs.cs
- MethodExecutor.cs
- TypeBuilder.cs
- DataControlFieldCell.cs
- RequestNavigateEventArgs.cs
- GcHandle.cs
- RubberbandSelector.cs
- DesignDataSource.cs
- ByteConverter.cs
- sqlser.cs
- BitmapPalettes.cs
- ExpressionEvaluator.cs
- IisTraceListener.cs
- PropertyAccessVisitor.cs
- WebPartUserCapability.cs
- PassportAuthenticationEventArgs.cs
- LingerOption.cs
- ScopelessEnumAttribute.cs
- Visual3DCollection.cs
- ReadingWritingEntityEventArgs.cs
- BamlRecordReader.cs
- WindowShowOrOpenTracker.cs
- TypedDatasetGenerator.cs
- TimersDescriptionAttribute.cs
- SafeReadContext.cs
- AttributeQuery.cs
- WebPartCloseVerb.cs
- CaseInsensitiveHashCodeProvider.cs
- RegexFCD.cs
- HtmlForm.cs
- Drawing.cs
- ProxyHwnd.cs
- PartialArray.cs
- WindowsGraphics2.cs
- Grant.cs
- RegisteredScript.cs
- ComplexObject.cs
- VectorKeyFrameCollection.cs
- NavigationProgressEventArgs.cs
- StartUpEventArgs.cs
- StringWriter.cs
- SynchronizedInputProviderWrapper.cs
- ContextInformation.cs
- WebServicesSection.cs
- HwndPanningFeedback.cs
- AppSecurityManager.cs
- IndexedString.cs
- SafeFileMappingHandle.cs
- XamlReaderConstants.cs
- WaitHandleCannotBeOpenedException.cs
- InstancePersistenceCommand.cs
- AsyncDataRequest.cs
- CellParaClient.cs
- WindowsListViewScroll.cs
- RealProxy.cs
- WmpBitmapEncoder.cs
- InstanceData.cs
- DataGridViewRowsRemovedEventArgs.cs
- LinqDataSource.cs
- Size3DValueSerializer.cs
- SqlNodeTypeOperators.cs
- SizeValueSerializer.cs
- LowerCaseStringConverter.cs
- ListControlConvertEventArgs.cs
- WorkflowStateRollbackService.cs
- XmlEntity.cs
- ThemeDirectoryCompiler.cs
- IndentTextWriter.cs
- ETagAttribute.cs
- __Filters.cs
- CodeAccessSecurityEngine.cs
- ConfigurationManager.cs
- Parser.cs