Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / infocard / Service / managed / Microsoft / InfoCards / SelfIssuedAuthRSAPKCS1SignatureFormatter.cs / 1 / SelfIssuedAuthRSAPKCS1SignatureFormatter.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- // namespace Microsoft.InfoCards { using System; using System.IdentityModel.Selectors; using System.IdentityModel.Tokens; using System.ServiceModel; using System.ServiceModel.Security; using System.ServiceModel.Security.Tokens; using System.Runtime.InteropServices; using System.Security.Cryptography; using System.IdentityModel; using System.Security.Cryptography.Xml; using IDT = Microsoft.InfoCards.Diagnostics.InfoCardTrace; using System.Collections.ObjectModel; using System.Collections.Generic; // // Summary: // This class implements the mechanism to call SelfIssuedAuthRSACryptoProvider's SignHash // internal class SelfIssuedAuthRSAPKCS1SignatureFormatter : RSAPKCS1SignatureFormatter { private RSA m_rsaKey; private string m_strOID; // // public constructors // public SelfIssuedAuthRSAPKCS1SignatureFormatter() : base() { } public SelfIssuedAuthRSAPKCS1SignatureFormatter( 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 SelfIssuedAuthRSACryptoProvider ) { return ( ( SelfIssuedAuthRSACryptoProvider )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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SignedXml.cs
- ExpressionConverter.cs
- RootCodeDomSerializer.cs
- CustomWebEventKey.cs
- ExecutionScope.cs
- SamlAuthorityBinding.cs
- WebPartMinimizeVerb.cs
- DesignerTransactionCloseEvent.cs
- ExtensionDataObject.cs
- BuildProvider.cs
- EmptyEnumerable.cs
- Not.cs
- DBDataPermission.cs
- HideDisabledControlAdapter.cs
- ConvertersCollection.cs
- FrameworkRichTextComposition.cs
- InkCanvas.cs
- UpdateCommand.cs
- Scheduler.cs
- XmlUtilWriter.cs
- RootNamespaceAttribute.cs
- WebUtil.cs
- Vector3DKeyFrameCollection.cs
- XmlElementList.cs
- QuarticEase.cs
- Quaternion.cs
- InfocardChannelParameter.cs
- Style.cs
- AuthenticationModuleElementCollection.cs
- StringConcat.cs
- StorageFunctionMapping.cs
- CryptoApi.cs
- AudioStateChangedEventArgs.cs
- LOSFormatter.cs
- RemoteWebConfigurationHost.cs
- LocalFileSettingsProvider.cs
- ActionFrame.cs
- MetafileHeaderWmf.cs
- DocumentViewer.cs
- LayoutEvent.cs
- CodeDirectiveCollection.cs
- HitTestParameters.cs
- ToolStripSystemRenderer.cs
- ObjectManager.cs
- WindowsClaimSet.cs
- ElementHostAutomationPeer.cs
- XmlArrayAttribute.cs
- SrgsGrammarCompiler.cs
- PropertyEmitterBase.cs
- BuildProviderCollection.cs
- DictionaryMarkupSerializer.cs
- BooleanConverter.cs
- AppDomainEvidenceFactory.cs
- ResourceCategoryAttribute.cs
- objectresult_tresulttype.cs
- GridViewPageEventArgs.cs
- CacheOutputQuery.cs
- PluralizationService.cs
- GeneratedView.cs
- Stylus.cs
- HwndHost.cs
- Claim.cs
- AutoResizedEvent.cs
- BinaryObjectInfo.cs
- MailMessageEventArgs.cs
- SqlDataSource.cs
- RegexStringValidatorAttribute.cs
- PageCatalogPart.cs
- ContainerControl.cs
- ViewKeyConstraint.cs
- ReferenceService.cs
- PeerName.cs
- QuaternionKeyFrameCollection.cs
- InputLanguageProfileNotifySink.cs
- EmptyCollection.cs
- WmlFormAdapter.cs
- HashJoinQueryOperatorEnumerator.cs
- UnknownBitmapEncoder.cs
- TreeView.cs
- CounterSample.cs
- DataSourceExpressionCollection.cs
- KnownColorTable.cs
- SystemIPInterfaceProperties.cs
- Int64.cs
- PersonalizableAttribute.cs
- WebZone.cs
- BitmapEffectGeneralTransform.cs
- XmlAnyElementAttributes.cs
- ErrorFormatterPage.cs
- LiteralControl.cs
- IISMapPath.cs
- TimeSpanOrInfiniteConverter.cs
- PageStatePersister.cs
- ConfigurationSectionHelper.cs
- MulticastIPAddressInformationCollection.cs
- GraphicsPath.cs
- DeclaredTypeValidatorAttribute.cs
- HtmlEmptyTagControlBuilder.cs
- RepeaterCommandEventArgs.cs
- ProjectionCamera.cs