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
- Fonts.cs
- TreeViewItem.cs
- ActivityXamlServices.cs
- ApplicationException.cs
- SecurityPolicySection.cs
- InputLangChangeRequestEvent.cs
- MethodCallConverter.cs
- MsmqBindingMonitor.cs
- TextTreeObjectNode.cs
- RenderDataDrawingContext.cs
- StandardBindingElementCollection.cs
- BitmapFrameDecode.cs
- ImageSource.cs
- WebControlsSection.cs
- OleDbFactory.cs
- NavigationHelper.cs
- DPCustomTypeDescriptor.cs
- IProvider.cs
- CompilerScope.Storage.cs
- CodeChecksumPragma.cs
- LinqDataSource.cs
- MetadataUtilsSmi.cs
- GridViewColumnHeader.cs
- ConnectionsZone.cs
- Registry.cs
- BasicViewGenerator.cs
- MatrixCamera.cs
- TextEditorMouse.cs
- PropVariant.cs
- WebBrowser.cs
- GenericTextProperties.cs
- UIElementCollection.cs
- XmlSchemaAttributeGroup.cs
- ListViewItem.cs
- Stylesheet.cs
- DropTarget.cs
- ViewLoader.cs
- MailDefinition.cs
- PriorityBinding.cs
- FontUnit.cs
- TextPattern.cs
- AnimatedTypeHelpers.cs
- BatchStream.cs
- CharacterMetrics.cs
- PageParserFilter.cs
- CreateUserErrorEventArgs.cs
- RegexNode.cs
- HttpAsyncResult.cs
- GlobalAllocSafeHandle.cs
- SiteMapNode.cs
- CodePageEncoding.cs
- MarginCollapsingState.cs
- ScaleTransform3D.cs
- ChildTable.cs
- Utils.cs
- DelimitedListTraceListener.cs
- DataServiceQueryException.cs
- WindowsToolbarAsMenu.cs
- TokenizerHelper.cs
- WindowsGraphics2.cs
- WithParamAction.cs
- XmlNavigatorStack.cs
- TextCompositionManager.cs
- ExtractedStateEntry.cs
- WindowsAuthenticationEventArgs.cs
- CompilerLocalReference.cs
- AudioSignalProblemOccurredEventArgs.cs
- Directory.cs
- QuadraticBezierSegment.cs
- MaterialCollection.cs
- Repeater.cs
- PeerCollaboration.cs
- ConfigXmlDocument.cs
- TextEditorTables.cs
- IODescriptionAttribute.cs
- MarkupObject.cs
- DataGridViewColumnCollection.cs
- SQLConvert.cs
- TextRenderer.cs
- TemplatePartAttribute.cs
- EventProviderWriter.cs
- DiscoveryClient.cs
- OutputCacheProfile.cs
- SerializationUtility.cs
- ProfileParameter.cs
- InputLanguageCollection.cs
- ScopedKnownTypes.cs
- TraceHandlerErrorFormatter.cs
- SEHException.cs
- ConditionCollection.cs
- DBSqlParser.cs
- SafeIUnknown.cs
- Span.cs
- OdbcDataReader.cs
- RelatedImageListAttribute.cs
- HtmlElementEventArgs.cs
- TreeViewImageIndexConverter.cs
- RunInstallerAttribute.cs
- DbgUtil.cs
- CompiledIdentityConstraint.cs