Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / infocard / Service / managed / Microsoft / InfoCards / RemoteAsymmetricSignatureFormatter.cs / 1 / RemoteAsymmetricSignatureFormatter.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace Microsoft.InfoCards { using System; using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; using System.ServiceModel; using System.ServiceModel.Security; using System.ServiceModel.Security.Tokens; using IDT = Microsoft.InfoCards.Diagnostics.InfoCardTrace; // // Summary: // Signature formater for use with RemoteCryptoRsaServiceProvider // class RemoteAsymmetricSignatureFormatter : AsymmetricSignatureFormatter { RemoteCryptoRsaServiceProvider m_rsa; string m_hashOidString; int m_nativeHashType; public RemoteAsymmetricSignatureFormatter() : base() { } // // Summary: // Create the new signature. // // Arguments: // rgbHash: the hash value to sign. // // Returns: // The signature value. // public override byte[] CreateSignature(byte[] rgbHash) { if( null == m_rsa ) { throw IDT.ThrowHelperError( new ArgumentException( "m_rsa" ) ); } if( String.IsNullOrEmpty( m_hashOidString ) ) { throw IDT.ThrowHelperError( new ArgumentException( "m_hashOidString" ) ); } if( null == rgbHash ) { throw IDT.ThrowHelperError( new ArgumentNullException( "rgbHash" ) ); } byte[] signature = m_rsa.SignHash( m_nativeHashType, rgbHash ); return signature; } // // Summary: // Sets the hash algorithm // // Arguments: // strName: the string name of the algorithm. // public override void SetHashAlgorithm(string strName) { m_hashOidString = CryptoConfig.MapNameToOID( strName ); m_nativeHashType = NativeMcppMethods.CryptAlgIdFromOid( m_hashOidString ); } // // Summary: // Set the current ket set for use in signing. // // Arguments: // key: The key to use. Must be a RemoteCryptoRsaServiceProvider instance. // public override void SetKey(AsymmetricAlgorithm key) { m_rsa = key as RemoteCryptoRsaServiceProvider; if( null == m_rsa ) { throw IDT.ThrowHelperError( new NotSupportedException() ); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- UserPreferenceChangedEventArgs.cs
- XmlSchemaValidator.cs
- SqlCaseSimplifier.cs
- ThemeableAttribute.cs
- ErasingStroke.cs
- ToolZone.cs
- LowerCaseStringConverter.cs
- FlowDocumentReader.cs
- DesigntimeLicenseContext.cs
- SimplePropertyEntry.cs
- AssemblyNameProxy.cs
- SqlDependencyUtils.cs
- smtppermission.cs
- SingletonChannelAcceptor.cs
- StrokeNodeOperations2.cs
- DataGridViewRow.cs
- GridViewRowPresenterBase.cs
- ReferencedCategoriesDocument.cs
- CompensationParticipant.cs
- DES.cs
- NativeMethods.cs
- VariableAction.cs
- COM2PropertyPageUITypeConverter.cs
- CorrelationValidator.cs
- ArithmeticLiteral.cs
- TableLayoutCellPaintEventArgs.cs
- GiveFeedbackEvent.cs
- Empty.cs
- CodeTypeConstructor.cs
- ThicknessAnimation.cs
- ScrollBar.cs
- SqlTriggerContext.cs
- CollectionChangeEventArgs.cs
- WebPartsSection.cs
- StoryFragments.cs
- ArraySegment.cs
- SmiRecordBuffer.cs
- JsonReaderDelegator.cs
- Random.cs
- ProcessModelSection.cs
- SignerInfo.cs
- XmlDownloadManager.cs
- EncryptedPackageFilter.cs
- DataGridTextBoxColumn.cs
- CodeDirectiveCollection.cs
- ObjectViewQueryResultData.cs
- HostedTransportConfigurationManager.cs
- TemplatePropertyEntry.cs
- _OSSOCK.cs
- ImageConverter.cs
- BaseCodePageEncoding.cs
- QilUnary.cs
- FormViewDeleteEventArgs.cs
- PageParserFilter.cs
- DynamicDataManager.cs
- WindowsFormsHelpers.cs
- MetabaseReader.cs
- XhtmlBasicPageAdapter.cs
- Utils.cs
- CrossContextChannel.cs
- TrackingServices.cs
- ComContractElementCollection.cs
- DesignBindingValueUIHandler.cs
- SafeSecurityHandles.cs
- EventItfInfo.cs
- ConfigPathUtility.cs
- KeyedHashAlgorithm.cs
- RawKeyboardInputReport.cs
- EllipticalNodeOperations.cs
- Function.cs
- QilPatternFactory.cs
- BoundPropertyEntry.cs
- TemplateControlCodeDomTreeGenerator.cs
- DESCryptoServiceProvider.cs
- FolderLevelBuildProviderCollection.cs
- HtmlTableRow.cs
- KnownBoxes.cs
- HideDisabledControlAdapter.cs
- FixUp.cs
- Int64Converter.cs
- nulltextnavigator.cs
- XmlSchemaSimpleContentExtension.cs
- ListViewGroupItemCollection.cs
- UriTemplateMatchException.cs
- Types.cs
- ClientTargetSection.cs
- SupportsEventValidationAttribute.cs
- ItemAutomationPeer.cs
- FixedLineResult.cs
- WindowsGrip.cs
- SemanticBasicElement.cs
- MimeAnyImporter.cs
- DurationConverter.cs
- WebPartConnectionsDisconnectVerb.cs
- SmiRequestExecutor.cs
- ValidationManager.cs
- CanExecuteRoutedEventArgs.cs
- RichTextBox.cs
- ObjectSpanRewriter.cs
- ValidationSummary.cs