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
- ProcessRequestArgs.cs
- Typography.cs
- CodeStatementCollection.cs
- dataSvcMapFileLoader.cs
- PipeSecurity.cs
- TextEndOfSegment.cs
- IndentTextWriter.cs
- FieldToken.cs
- DataGridViewSelectedCellCollection.cs
- CompilerErrorCollection.cs
- PrivacyNoticeElement.cs
- ContainerSelectorBehavior.cs
- ToolBarTray.cs
- SimpleBitVector32.cs
- WebBrowserHelper.cs
- FileEnumerator.cs
- PtsHelper.cs
- _ShellExpression.cs
- HttpSessionStateBase.cs
- OledbConnectionStringbuilder.cs
- ThicknessAnimation.cs
- Publisher.cs
- Italic.cs
- StorageAssociationSetMapping.cs
- RSAProtectedConfigurationProvider.cs
- Switch.cs
- WebMessageEncoderFactory.cs
- MenuBase.cs
- WebMessageFormatHelper.cs
- ToolStripSettings.cs
- PropertyEntry.cs
- PermissionSetTriple.cs
- SqlRewriteScalarSubqueries.cs
- RegexParser.cs
- UnauthorizedAccessException.cs
- ImageSource.cs
- OnOperation.cs
- MetadataException.cs
- CodeObject.cs
- GcHandle.cs
- BlurEffect.cs
- InvalidCastException.cs
- PartialList.cs
- sqlstateclientmanager.cs
- GridViewHeaderRowPresenter.cs
- SmiTypedGetterSetter.cs
- ActivityValidator.cs
- versioninfo.cs
- TreeBuilderBamlTranslator.cs
- PlatformCulture.cs
- WorkflowDefinitionDispenser.cs
- WebPartCancelEventArgs.cs
- GeneratedContractType.cs
- TileBrush.cs
- WebPartConnectionsConnectVerb.cs
- OdbcConnectionString.cs
- SoapException.cs
- XmlAttributeOverrides.cs
- TypeBuilderInstantiation.cs
- PreviousTrackingServiceAttribute.cs
- RadialGradientBrush.cs
- ProfileElement.cs
- XmlChildEnumerator.cs
- PathSegment.cs
- ListControl.cs
- ProxyWebPart.cs
- DtdParser.cs
- DataError.cs
- ArrayHelper.cs
- OleDbReferenceCollection.cs
- ClientBuildManager.cs
- EntityPropertyMappingAttribute.cs
- Int64AnimationUsingKeyFrames.cs
- BCLDebug.cs
- ModelVisual3D.cs
- RepeatEnumerable.cs
- LocalClientSecuritySettings.cs
- LogStore.cs
- BoundColumn.cs
- ListCollectionView.cs
- ObjectSet.cs
- WebPartDisplayModeEventArgs.cs
- ISCIIEncoding.cs
- CapabilitiesRule.cs
- ExeConfigurationFileMap.cs
- DataListItemEventArgs.cs
- Tile.cs
- ResetableIterator.cs
- autovalidator.cs
- InvalidWMPVersionException.cs
- ContainerUIElement3D.cs
- TabItem.cs
- CodeMethodReturnStatement.cs
- _BaseOverlappedAsyncResult.cs
- XmlSchemaAnnotated.cs
- MailAddressCollection.cs
- LongSumAggregationOperator.cs
- OperationGenerator.cs
- Stylus.cs
- Compensate.cs