Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / infocard / Client / System / IdentityModel / Selectors / InfoCardRSAPKCS1KeyExchangeFormatter.cs / 1305376 / InfoCardRSAPKCS1KeyExchangeFormatter.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.IdentityModel.Selectors { using System; using System.Security.Cryptography; internal class InfoCardRSAPKCS1KeyExchangeFormatter : RSAPKCS1KeyExchangeFormatter { RSA m_rsaKey; // // public constructors // public InfoCardRSAPKCS1KeyExchangeFormatter() : base() {} public InfoCardRSAPKCS1KeyExchangeFormatter(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 byte[] CreateKeyExchange(byte[] rgbData) { if ( null != m_rsaKey && m_rsaKey is InfoCardRSACryptoProvider) { return ((InfoCardRSACryptoProvider) m_rsaKey).Encrypt(rgbData, false); } else { return base.CreateKeyExchange( rgbData ); } } } } // 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 InfoCardRSAPKCS1KeyExchangeFormatter : RSAPKCS1KeyExchangeFormatter { RSA m_rsaKey; // // public constructors // public InfoCardRSAPKCS1KeyExchangeFormatter() : base() {} public InfoCardRSAPKCS1KeyExchangeFormatter(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 byte[] CreateKeyExchange(byte[] rgbData) { if ( null != m_rsaKey && m_rsaKey is InfoCardRSACryptoProvider) { return ((InfoCardRSACryptoProvider) m_rsaKey).Encrypt(rgbData, false); } else { return base.CreateKeyExchange( rgbData ); } } } } // 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
- TagPrefixCollection.cs
- SeverityFilter.cs
- StylusPointCollection.cs
- XamlTreeBuilder.cs
- Color.cs
- InfoCardClaimCollection.cs
- Pair.cs
- WorkflowDesignerMessageFilter.cs
- TrustManagerMoreInformation.cs
- XmlDocument.cs
- FormsAuthenticationEventArgs.cs
- SqlProfileProvider.cs
- Semaphore.cs
- CompilerInfo.cs
- PipeConnection.cs
- GridViewPageEventArgs.cs
- ExpressionBindingCollection.cs
- BitmapMetadataBlob.cs
- PersonalizableAttribute.cs
- BasicBrowserDialog.designer.cs
- SourceItem.cs
- IProvider.cs
- GroupStyle.cs
- ValidatingReaderNodeData.cs
- ForEachAction.cs
- EventLogPermission.cs
- DataMisalignedException.cs
- ContentFileHelper.cs
- ToolStripMenuItem.cs
- GridLength.cs
- BasicBrowserDialog.cs
- WebBrowserPermission.cs
- FatalException.cs
- DoubleAnimationUsingKeyFrames.cs
- ObjectToken.cs
- DeclaredTypeValidatorAttribute.cs
- XmlBaseReader.cs
- WebPartConnectionsCancelEventArgs.cs
- DecimalConstantAttribute.cs
- Activator.cs
- Row.cs
- RoleGroup.cs
- ListBoxItem.cs
- DecoderReplacementFallback.cs
- InlinedAggregationOperator.cs
- KernelTypeValidation.cs
- EntityRecordInfo.cs
- ImageField.cs
- OracleNumber.cs
- DataGridViewTextBoxCell.cs
- XmlTypeAttribute.cs
- QueryRelOp.cs
- FixedSOMLineCollection.cs
- DataGridViewLinkCell.cs
- COM2ExtendedTypeConverter.cs
- SoapFormatExtensions.cs
- CodeCommentStatement.cs
- RIPEMD160.cs
- TextTabProperties.cs
- BevelBitmapEffect.cs
- Event.cs
- CriticalHandle.cs
- HtmlControl.cs
- DataColumnCollection.cs
- ObjectStorage.cs
- PackWebRequestFactory.cs
- SqlReferenceCollection.cs
- EncoderBestFitFallback.cs
- CustomGrammar.cs
- Ipv6Element.cs
- MasterPageCodeDomTreeGenerator.cs
- UserControl.cs
- PropertyGridDesigner.cs
- GenericEnumConverter.cs
- DbConnectionPoolGroupProviderInfo.cs
- ToolStripButton.cs
- PageThemeCodeDomTreeGenerator.cs
- DbParameterCollectionHelper.cs
- ErrorHandler.cs
- DataServiceQueryOfT.cs
- DbXmlEnabledProviderManifest.cs
- HMACSHA1.cs
- HttpModulesSection.cs
- ListView.cs
- AssignDesigner.xaml.cs
- QueryMath.cs
- __FastResourceComparer.cs
- ObjectManager.cs
- RequestResizeEvent.cs
- Repeater.cs
- ConnectionProviderAttribute.cs
- RequestValidator.cs
- UniqueIdentifierService.cs
- HostSecurityManager.cs
- AddInEnvironment.cs
- ConfigurationManagerInternal.cs
- BeginSelectCardRequest.cs
- SocketInformation.cs
- XmlChildEnumerator.cs
- RegexCode.cs