Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / infocard / Client / System / IdentityModel / Selectors / InfoCardRSAOAEPKeyExchangeDeformatter.cs / 1305376 / InfoCardRSAOAEPKeyExchangeDeformatter.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.IdentityModel.Selectors { using System; using System.Security.Cryptography; internal class InfoCardRSAOAEPKeyExchangeDeformatter : RSAOAEPKeyExchangeDeformatter { private RSA m_rsaKey; // RSA Key value to do decrypt operation // // public constructors // public InfoCardRSAOAEPKeyExchangeDeformatter() : base() {} public InfoCardRSAOAEPKeyExchangeDeformatter( AsymmetricAlgorithm key ) : base( key ) { m_rsaKey = (RSA) key; } // // public methods // public override byte[] DecryptKeyExchange( byte[] rgbData ) { if ( null != m_rsaKey && m_rsaKey is InfoCardRSACryptoProvider ) { return ((InfoCardRSACryptoProvider) m_rsaKey).Decrypt( rgbData, true ); } else { return base.DecryptKeyExchange( rgbData ); } } public override void SetKey( AsymmetricAlgorithm key ) { base.SetKey( key ); m_rsaKey = (RSA) key; } } } // 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 InfoCardRSAOAEPKeyExchangeDeformatter : RSAOAEPKeyExchangeDeformatter { private RSA m_rsaKey; // RSA Key value to do decrypt operation // // public constructors // public InfoCardRSAOAEPKeyExchangeDeformatter() : base() {} public InfoCardRSAOAEPKeyExchangeDeformatter( AsymmetricAlgorithm key ) : base( key ) { m_rsaKey = (RSA) key; } // // public methods // public override byte[] DecryptKeyExchange( byte[] rgbData ) { if ( null != m_rsaKey && m_rsaKey is InfoCardRSACryptoProvider ) { return ((InfoCardRSACryptoProvider) m_rsaKey).Decrypt( rgbData, true ); } else { return base.DecryptKeyExchange( rgbData ); } } public override void SetKey( AsymmetricAlgorithm key ) { base.SetKey( key ); m_rsaKey = (RSA) key; } } } // 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
- OutputChannel.cs
- MetadataHelper.cs
- WebServiceFaultDesigner.cs
- DiffuseMaterial.cs
- PreviewControlDesigner.cs
- Workspace.cs
- FixedDSBuilder.cs
- ToolStripRenderer.cs
- SamlEvidence.cs
- CodeEventReferenceExpression.cs
- SQLBinary.cs
- RemoteEndpointMessageProperty.cs
- ModifierKeysConverter.cs
- DataSourceExpressionCollection.cs
- GroupBoxRenderer.cs
- NamespaceList.cs
- SqlHelper.cs
- XpsManager.cs
- LicenseException.cs
- CodeVariableReferenceExpression.cs
- DataFormats.cs
- CloudCollection.cs
- MexTcpBindingElement.cs
- SecureEnvironment.cs
- CriticalExceptions.cs
- TripleDES.cs
- PathFigureCollection.cs
- StorageTypeMapping.cs
- FontStretchConverter.cs
- InkCanvasSelectionAdorner.cs
- SelectionEditor.cs
- AppDomainUnloadedException.cs
- TogglePattern.cs
- BindingExpression.cs
- StrongNamePublicKeyBlob.cs
- TriggerBase.cs
- Matrix.cs
- PaginationProgressEventArgs.cs
- FlowDocumentPage.cs
- QilValidationVisitor.cs
- PageThemeCodeDomTreeGenerator.cs
- CallSite.cs
- Image.cs
- DataGridViewComboBoxColumn.cs
- BaseComponentEditor.cs
- GridViewAutomationPeer.cs
- PreservationFileReader.cs
- Literal.cs
- HttpProfileGroupBase.cs
- ProtocolsConfiguration.cs
- Graph.cs
- Label.cs
- HitTestParameters.cs
- CollectionBuilder.cs
- RuntimeCompatibilityAttribute.cs
- ReachSerializableProperties.cs
- BindableAttribute.cs
- StructuredTypeEmitter.cs
- DnsElement.cs
- JulianCalendar.cs
- WorkItem.cs
- SafeThemeHandle.cs
- WebColorConverter.cs
- ImageMapEventArgs.cs
- TimerExtension.cs
- ReadOnlyDictionary.cs
- EmptyCollection.cs
- StringSource.cs
- DigitShape.cs
- PrintEvent.cs
- NameValuePair.cs
- MdiWindowListStrip.cs
- PositiveTimeSpanValidatorAttribute.cs
- ResourceManager.cs
- hresults.cs
- Expressions.cs
- XamlSerializerUtil.cs
- HttpRequestCacheValidator.cs
- PolicyLevel.cs
- CellTreeNodeVisitors.cs
- FileUtil.cs
- SignalGate.cs
- Soap.cs
- CFStream.cs
- TextElementCollection.cs
- ListViewItemSelectionChangedEvent.cs
- DbTransaction.cs
- LiteralTextParser.cs
- DeflateEmulationStream.cs
- DataGridCommandEventArgs.cs
- LinkLabel.cs
- ConnectAlgorithms.cs
- RouteCollection.cs
- XmlQueryType.cs
- AlphabeticalEnumConverter.cs
- GlyphRunDrawing.cs
- ToolStripItem.cs
- TerminateSequenceResponse.cs
- SamlAuthorityBinding.cs
- FixedSOMTable.cs