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
- xmlfixedPageInfo.cs
- TcpAppDomainProtocolHandler.cs
- NullableDoubleAverageAggregationOperator.cs
- WindowsFormsHelpers.cs
- GlyphInfoList.cs
- FileAuthorizationModule.cs
- SortAction.cs
- SemanticResolver.cs
- SqlDataSourceEnumerator.cs
- WebOperationContext.cs
- ReverseInheritProperty.cs
- XmlSchemaAnnotated.cs
- MultiSelectRootGridEntry.cs
- TTSEvent.cs
- DataContractJsonSerializer.cs
- NativeMethods.cs
- IPAddressCollection.cs
- ProcessModelSection.cs
- XmlRootAttribute.cs
- ImageSourceConverter.cs
- CommunicationObjectFaultedException.cs
- XmlTextEncoder.cs
- TypeConverterAttribute.cs
- TableLayoutPanel.cs
- LinqDataSourceValidationException.cs
- OverflowException.cs
- UpdateCommand.cs
- DictionaryItemsCollection.cs
- Nodes.cs
- HtmlInputButton.cs
- OptimizerPatterns.cs
- SqlDeflator.cs
- TextServicesDisplayAttribute.cs
- IndexOutOfRangeException.cs
- SafeReversePInvokeHandle.cs
- AppModelKnownContentFactory.cs
- AutomationElementCollection.cs
- DashStyles.cs
- Drawing.cs
- AutoResizedEvent.cs
- ThreadPoolTaskScheduler.cs
- EventLogPermission.cs
- HtmlButton.cs
- Line.cs
- InvokePattern.cs
- CFStream.cs
- GeometryModel3D.cs
- StyleCollectionEditor.cs
- Marshal.cs
- PinnedBufferMemoryStream.cs
- WebPartCollection.cs
- XmlNamedNodeMap.cs
- SqlAliaser.cs
- StreamReader.cs
- CodeGenerator.cs
- CodeAccessPermission.cs
- WebPartMinimizeVerb.cs
- NameValueConfigurationCollection.cs
- LingerOption.cs
- UpWmlPageAdapter.cs
- WhitespaceSignificantCollectionAttribute.cs
- HexParser.cs
- FormViewInsertedEventArgs.cs
- UnsafeNativeMethods.cs
- DbMetaDataColumnNames.cs
- EUCJPEncoding.cs
- DeclarativeConditionsCollection.cs
- DataGridSortCommandEventArgs.cs
- _ConnectOverlappedAsyncResult.cs
- DocumentSignatureManager.cs
- ScriptIgnoreAttribute.cs
- DataGridViewCellFormattingEventArgs.cs
- X509Extension.cs
- SafeBitVector32.cs
- Schema.cs
- SamlEvidence.cs
- ScaleTransform3D.cs
- ServiceDescriptionData.cs
- ResourcePool.cs
- GB18030Encoding.cs
- SessionSwitchEventArgs.cs
- FixedSOMContainer.cs
- DataGridBeginningEditEventArgs.cs
- DateBoldEvent.cs
- DeclaredTypeValidatorAttribute.cs
- IncrementalReadDecoders.cs
- DbDeleteCommandTree.cs
- XPathScanner.cs
- MsmqNonTransactedPoisonHandler.cs
- ErrorProvider.cs
- DoubleStorage.cs
- XmlSchemaDocumentation.cs
- RuntimeConfig.cs
- SecurityDocument.cs
- CommandValueSerializer.cs
- ToolStripArrowRenderEventArgs.cs
- Task.cs
- SocketManager.cs
- OneToOneMappingSerializer.cs
- AvTraceDetails.cs