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
- EdmConstants.cs
- DirectoryObjectSecurity.cs
- CodeRegionDirective.cs
- VersionedStream.cs
- DesignTimeData.cs
- RuntimeHelpers.cs
- OleDbConnection.cs
- CompiledAction.cs
- CodeRegionDirective.cs
- ImageEditor.cs
- MembershipSection.cs
- SqlDataSourceConfigureFilterForm.cs
- OSFeature.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- ScriptReferenceBase.cs
- _SslState.cs
- METAHEADER.cs
- PerformanceCounterCategory.cs
- ApplicationProxyInternal.cs
- Visual3DCollection.cs
- ListViewItemEventArgs.cs
- MissingMemberException.cs
- DataControlPagerLinkButton.cs
- Subtree.cs
- SqlGenerator.cs
- ImageAttributes.cs
- ApplicationHost.cs
- PointAnimationUsingPath.cs
- GeneralTransform3DGroup.cs
- XPathNavigator.cs
- Input.cs
- StringOutput.cs
- IWorkflowDebuggerService.cs
- WSSecureConversation.cs
- WriteTimeStream.cs
- DataGridClipboardHelper.cs
- ComponentDispatcherThread.cs
- Crypto.cs
- GlobalizationSection.cs
- TextFindEngine.cs
- DetailsViewModeEventArgs.cs
- ReferentialConstraint.cs
- DataRowView.cs
- StyleConverter.cs
- StringUtil.cs
- UnhandledExceptionEventArgs.cs
- DataSourceHelper.cs
- MethodRental.cs
- PageBuildProvider.cs
- DeclarationUpdate.cs
- DoubleAnimationClockResource.cs
- Completion.cs
- SafeArchiveContext.cs
- UniqueTransportManagerRegistration.cs
- JsonReader.cs
- OracleException.cs
- DbConnectionStringBuilder.cs
- ParallelDesigner.cs
- ProcessModelInfo.cs
- DefaultTextStoreTextComposition.cs
- NotifyInputEventArgs.cs
- DiscoveryServerProtocol.cs
- SqlNotificationEventArgs.cs
- XPathException.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- _SafeNetHandles.cs
- Variable.cs
- SwitchAttribute.cs
- SystemColors.cs
- NativeMethods.cs
- SoapSchemaMember.cs
- MergeLocalizationDirectives.cs
- PrinterUnitConvert.cs
- EntityTransaction.cs
- BamlWriter.cs
- UndirectedGraph.cs
- TimeoutConverter.cs
- ProfileModule.cs
- KeyboardDevice.cs
- SessionStateSection.cs
- NetWebProxyFinder.cs
- XAMLParseException.cs
- HttpRawResponse.cs
- BitmapEffectInputConnector.cs
- Geometry3D.cs
- BigInt.cs
- TrustManagerPromptUI.cs
- ModelPropertyImpl.cs
- XmlnsCache.cs
- RepeaterItem.cs
- DataGridColumn.cs
- HtmlEncodedRawTextWriter.cs
- CodeDomSerializerException.cs
- TextEffectResolver.cs
- WebPartsPersonalization.cs
- SharedStatics.cs
- DependencyPropertyHelper.cs
- ProxyWebPartManager.cs
- HierarchicalDataBoundControl.cs
- MulticastIPAddressInformationCollection.cs