Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / infocard / Client / System / IdentityModel / Selectors / InfoCardRSAPKCS1SignatureFormatter.cs / 1305376 / InfoCardRSAPKCS1SignatureFormatter.cs
//------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
namespace System.IdentityModel.Selectors
{
using System;
using System.Security.Cryptography;
internal class InfoCardRSAPKCS1SignatureFormatter : RSAPKCS1SignatureFormatter
{
private RSA m_rsaKey;
private string m_strOID;
//
// public constructors
//
public InfoCardRSAPKCS1SignatureFormatter() : base() {}
public InfoCardRSAPKCS1SignatureFormatter( 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 byte[] CreateSignature(byte[] rgbHash) {
if ( !( null == m_strOID || null == m_rsaKey || null == rgbHash ) && m_rsaKey is InfoCardRSACryptoProvider )
{
return ((InfoCardRSACryptoProvider) m_rsaKey).SignHash( rgbHash, m_strOID );
}
else
{
return base.CreateSignature( rgbHash );
}
}
}
}
// 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 InfoCardRSAPKCS1SignatureFormatter : RSAPKCS1SignatureFormatter
{
private RSA m_rsaKey;
private string m_strOID;
//
// public constructors
//
public InfoCardRSAPKCS1SignatureFormatter() : base() {}
public InfoCardRSAPKCS1SignatureFormatter( 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 byte[] CreateSignature(byte[] rgbHash) {
if ( !( null == m_strOID || null == m_rsaKey || null == rgbHash ) && m_rsaKey is InfoCardRSACryptoProvider )
{
return ((InfoCardRSACryptoProvider) m_rsaKey).SignHash( rgbHash, m_strOID );
}
else
{
return base.CreateSignature( rgbHash );
}
}
}
}
// 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
- LineSegment.cs
- CharStorage.cs
- Pen.cs
- PostBackOptions.cs
- SystemColors.cs
- RegistrySecurity.cs
- DataPagerFieldCommandEventArgs.cs
- PartialList.cs
- AppDomainAttributes.cs
- FormsAuthenticationCredentials.cs
- DoubleLinkList.cs
- CompilerInfo.cs
- SmtpSection.cs
- ProxyElement.cs
- UnsafeNetInfoNativeMethods.cs
- EmptyControlCollection.cs
- MultipartContentParser.cs
- IndependentlyAnimatedPropertyMetadata.cs
- BindingUtils.cs
- NavigationService.cs
- PostBackTrigger.cs
- Avt.cs
- RoleManagerEventArgs.cs
- DetailsViewUpdateEventArgs.cs
- TextViewSelectionProcessor.cs
- ContentOperations.cs
- CustomSignedXml.cs
- ExecutionEngineException.cs
- BuildManagerHost.cs
- CheckBoxBaseAdapter.cs
- DataGridViewCellConverter.cs
- SchemaRegistration.cs
- Hashtable.cs
- SQLBytesStorage.cs
- DataGridViewCellStateChangedEventArgs.cs
- FormatterServices.cs
- TimeSpanOrInfiniteConverter.cs
- ImmutablePropertyDescriptorGridEntry.cs
- InstanceCollisionException.cs
- CommentAction.cs
- XmlUnspecifiedAttribute.cs
- RtfControlWordInfo.cs
- Debug.cs
- linebase.cs
- SingleConverter.cs
- ConfigurationStrings.cs
- DiscardableAttribute.cs
- OperandQuery.cs
- HelpInfo.cs
- DataPagerCommandEventArgs.cs
- WorkflowElementDialog.cs
- AuthenticationService.cs
- WpfMemberInvoker.cs
- FileDialog.cs
- SaveWorkflowAsyncResult.cs
- MenuRendererStandards.cs
- ObjectSpanRewriter.cs
- DataSourceView.cs
- ItemContainerPattern.cs
- ColorComboBox.cs
- WebPartVerbCollection.cs
- BooleanStorage.cs
- ObjectDataProvider.cs
- ResXResourceReader.cs
- RSAOAEPKeyExchangeDeformatter.cs
- Parameter.cs
- ReferencedType.cs
- FullTextBreakpoint.cs
- LinearGradientBrush.cs
- ToolStripStatusLabel.cs
- CompilationLock.cs
- ViewKeyConstraint.cs
- WindowsToolbarItemAsMenuItem.cs
- Logging.cs
- WebConfigurationManager.cs
- BuildDependencySet.cs
- IApplicationTrustManager.cs
- SQLSingle.cs
- ServiceManager.cs
- Sequence.cs
- StateInitializationDesigner.cs
- InnerItemCollectionView.cs
- TCPListener.cs
- MDIClient.cs
- Int32Animation.cs
- DataBindingCollectionConverter.cs
- ParseElement.cs
- ToolStripLabel.cs
- PartialCachingAttribute.cs
- SerTrace.cs
- SelectionPatternIdentifiers.cs
- SystemGatewayIPAddressInformation.cs
- XmlAttributeProperties.cs
- TypeValidationEventArgs.cs
- WebContext.cs
- XmlIncludeAttribute.cs
- DetailsViewPagerRow.cs
- BmpBitmapEncoder.cs
- XPathNavigatorReader.cs
- DataMemberConverter.cs