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
- DynamicEndpoint.cs
- PointAnimationUsingPath.cs
- FrameworkName.cs
- GeneralTransform3DTo2D.cs
- DesignerAdRotatorAdapter.cs
- ConfigUtil.cs
- OperationAbortedException.cs
- ControlParameter.cs
- CharEntityEncoderFallback.cs
- MaskDescriptors.cs
- TargetConverter.cs
- CapabilitiesAssignment.cs
- storagemappingitemcollection.viewdictionary.cs
- UnsupportedPolicyOptionsException.cs
- MetadataItemCollectionFactory.cs
- XmlSchemas.cs
- ArrayElementGridEntry.cs
- _ListenerRequestStream.cs
- DPTypeDescriptorContext.cs
- DoubleConverter.cs
- ClientRuntimeConfig.cs
- DoubleAnimationBase.cs
- DebugController.cs
- MappingModelBuildProvider.cs
- CacheAxisQuery.cs
- DataPager.cs
- WindowsComboBox.cs
- HMACSHA384.cs
- TemplateInstanceAttribute.cs
- ConstructorBuilder.cs
- ViewLoader.cs
- BaseResourcesBuildProvider.cs
- cookiecollection.cs
- MarshalDirectiveException.cs
- StylusPointCollection.cs
- CounterCreationDataCollection.cs
- QfeChecker.cs
- StubHelpers.cs
- CustomErrorsSection.cs
- Utility.cs
- XPathDocumentBuilder.cs
- TextEndOfParagraph.cs
- VarRefManager.cs
- DllNotFoundException.cs
- DynamicRendererThreadManager.cs
- ContentFileHelper.cs
- DataControlButton.cs
- NativeMethods.cs
- SerializationException.cs
- UdpContractFilterBehavior.cs
- FilterEventArgs.cs
- CustomAttributeFormatException.cs
- MultipartContentParser.cs
- PresentationTraceSources.cs
- ObjectDataSourceStatusEventArgs.cs
- Error.cs
- ResXDataNode.cs
- GregorianCalendarHelper.cs
- SrgsText.cs
- VersionPair.cs
- InputLangChangeEvent.cs
- MSAANativeProvider.cs
- TextFindEngine.cs
- ActiveXHelper.cs
- WebControlParameterProxy.cs
- TrustManager.cs
- FilterableData.cs
- ViewManagerAttribute.cs
- EncryptedXml.cs
- TraceXPathNavigator.cs
- ResourceAssociationType.cs
- TypeViewSchema.cs
- TypeUsageBuilder.cs
- RegisteredScript.cs
- mongolianshape.cs
- XDeferredAxisSource.cs
- DependencyObjectPropertyDescriptor.cs
- DiscoveryDocumentReference.cs
- TimelineClockCollection.cs
- AuthenticationServiceManager.cs
- WebPartDeleteVerb.cs
- OledbConnectionStringbuilder.cs
- WebHttpBehavior.cs
- SmiConnection.cs
- LOSFormatter.cs
- ModelItemCollection.cs
- CommentEmitter.cs
- HttpResponseBase.cs
- DataColumn.cs
- AxHost.cs
- FontInfo.cs
- RenamedEventArgs.cs
- SchemaImporterExtensionElementCollection.cs
- XsltException.cs
- BevelBitmapEffect.cs
- CompilerWrapper.cs
- XhtmlBasicControlAdapter.cs
- FloaterBaseParaClient.cs
- DesignerContextDescriptor.cs
- SamlSecurityToken.cs