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
- StringFormat.cs
- LazyTextWriterCreator.cs
- SemaphoreSecurity.cs
- PolicyStatement.cs
- ActivityCodeDomSerializer.cs
- BypassElement.cs
- BaseParser.cs
- ListItem.cs
- TypeLibConverter.cs
- AccessText.cs
- safelink.cs
- TimeSpanMinutesConverter.cs
- StringPropertyBuilder.cs
- DataFieldEditor.cs
- DependencyProperty.cs
- CompareValidator.cs
- PropagatorResult.cs
- StdValidatorsAndConverters.cs
- UdpUtility.cs
- CalendarKeyboardHelper.cs
- ConfigurationCollectionAttribute.cs
- ErrorFormatter.cs
- ProfileService.cs
- HandlerBase.cs
- ThumbAutomationPeer.cs
- TextTreeDeleteContentUndoUnit.cs
- ApplicationProxyInternal.cs
- DefaultValueConverter.cs
- GuidTagList.cs
- XmlSchemaNotation.cs
- RecognizerBase.cs
- CodeDomConfigurationHandler.cs
- TabRenderer.cs
- DisplayInformation.cs
- SchemaObjectWriter.cs
- WorkflowView.cs
- DecimalKeyFrameCollection.cs
- Application.cs
- WebPartMovingEventArgs.cs
- GroupJoinQueryOperator.cs
- SimpleHandlerFactory.cs
- NumericExpr.cs
- PenThreadPool.cs
- SqlClientFactory.cs
- ObfuscateAssemblyAttribute.cs
- sqlser.cs
- UnsafeNativeMethods.cs
- WebReference.cs
- ClientSettingsStore.cs
- DbTransaction.cs
- DefaultBinder.cs
- WorkflowTerminatedException.cs
- TrackBar.cs
- ActionMismatchAddressingException.cs
- Page.cs
- SystemUdpStatistics.cs
- FixedFlowMap.cs
- PassportAuthenticationModule.cs
- Model3DGroup.cs
- Thickness.cs
- TabControlToolboxItem.cs
- GridViewRowEventArgs.cs
- TextMetrics.cs
- DataBindingCollectionConverter.cs
- MasterPageBuildProvider.cs
- DesignerTextBoxAdapter.cs
- PeerObject.cs
- XmlSchemaFacet.cs
- CachedTypeface.cs
- OrthographicCamera.cs
- _SslStream.cs
- SqlInternalConnection.cs
- _IPv6Address.cs
- ChameleonKey.cs
- XmlCharCheckingWriter.cs
- ScriptReferenceBase.cs
- XmlSchemaCollection.cs
- TheQuery.cs
- PrintingPermissionAttribute.cs
- DisplayNameAttribute.cs
- CultureNotFoundException.cs
- BinaryCommonClasses.cs
- TargetControlTypeCache.cs
- TraceSection.cs
- HostedHttpRequestAsyncResult.cs
- Glyph.cs
- StyleSelector.cs
- webclient.cs
- InkPresenter.cs
- OdbcConnectionPoolProviderInfo.cs
- XPathDescendantIterator.cs
- ChtmlPhoneCallAdapter.cs
- ListCardsInFileRequest.cs
- FlowPosition.cs
- GeneralTransformGroup.cs
- entityreference_tresulttype.cs
- ValidatedControlConverter.cs
- DataMisalignedException.cs
- URLString.cs
- NamespaceList.cs