Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / infocard / Client / System / IdentityModel / Selectors / InfoCardRSAOAEPKeyExchangeFormatter.cs / 1305376 / InfoCardRSAOAEPKeyExchangeFormatter.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.IdentityModel.Selectors { using System; using System.Security.Cryptography; internal class InfoCardRSAOAEPKeyExchangeFormatter : RSAOAEPKeyExchangeFormatter { private RSA m_rsaKey; // // public constructors // public InfoCardRSAOAEPKeyExchangeFormatter() : base() {} public InfoCardRSAOAEPKeyExchangeFormatter( 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, true); } 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 InfoCardRSAOAEPKeyExchangeFormatter : RSAOAEPKeyExchangeFormatter { private RSA m_rsaKey; // // public constructors // public InfoCardRSAOAEPKeyExchangeFormatter() : base() {} public InfoCardRSAOAEPKeyExchangeFormatter( 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, true); } 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
- TableAdapterManagerHelper.cs
- ServiceOperationUIEditor.cs
- XmlException.cs
- CutCopyPasteHelper.cs
- BindingList.cs
- Menu.cs
- GenericUI.cs
- ReachFixedDocumentSerializer.cs
- PasswordTextNavigator.cs
- HttpProfileGroupBase.cs
- StyleBamlTreeBuilder.cs
- XmlRawWriter.cs
- ElementProxy.cs
- ConditionalBranch.cs
- QuotedStringFormatReader.cs
- FigureParagraph.cs
- EndpointDiscoveryMetadataCD1.cs
- DropDownList.cs
- PolyBezierSegmentFigureLogic.cs
- InputElement.cs
- Wizard.cs
- ContextMenuStrip.cs
- XmlQueryContext.cs
- FileLevelControlBuilderAttribute.cs
- MessageQueueAccessControlEntry.cs
- StructuralObject.cs
- DocumentXmlWriter.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- StateChangeEvent.cs
- MessageQueueTransaction.cs
- RewritingValidator.cs
- MarkupCompiler.cs
- ReflectionUtil.cs
- TranslateTransform3D.cs
- TreeNodeCollection.cs
- FillErrorEventArgs.cs
- Convert.cs
- Stylus.cs
- Hash.cs
- SpeechDetectedEventArgs.cs
- Vector3DAnimationBase.cs
- EditingCommands.cs
- CharacterString.cs
- OracleTransaction.cs
- SafeCryptHandles.cs
- ContentElement.cs
- Throw.cs
- CompoundFileDeflateTransform.cs
- XmlSchemaObject.cs
- WebBrowserPermission.cs
- SelectedDatesCollection.cs
- TraceContext.cs
- WhereQueryOperator.cs
- Matrix3DConverter.cs
- RuntimeVariablesExpression.cs
- PersistNameAttribute.cs
- Metadata.cs
- QilGeneratorEnv.cs
- CapabilitiesState.cs
- ContravarianceAdapter.cs
- EdmPropertyAttribute.cs
- VisualStates.cs
- QuaternionRotation3D.cs
- WrapPanel.cs
- InkCollectionBehavior.cs
- ErrorFormatter.cs
- StackOverflowException.cs
- TaskFormBase.cs
- _ProxyChain.cs
- ResourceProperty.cs
- XmlExtensionFunction.cs
- WindowsStartMenu.cs
- HttpCachePolicyBase.cs
- XmlNamespaceMappingCollection.cs
- AsymmetricKeyExchangeDeformatter.cs
- HtmlMeta.cs
- Label.cs
- SmtpNegotiateAuthenticationModule.cs
- HttpInputStream.cs
- Timer.cs
- GridView.cs
- SystemGatewayIPAddressInformation.cs
- FtpCachePolicyElement.cs
- StackBuilderSink.cs
- DoubleCollection.cs
- PerformanceCounterManager.cs
- SmiEventStream.cs
- RadioButton.cs
- EpmCustomContentWriterNodeData.cs
- NameScope.cs
- PersonalizationState.cs
- ReflectPropertyDescriptor.cs
- HttpWebResponse.cs
- BaseDataListComponentEditor.cs
- InternalControlCollection.cs
- IdentityManager.cs
- ConfigurationManager.cs
- RoleManagerSection.cs
- StylusDevice.cs
- selecteditemcollection.cs