Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / clr / src / BCL / System / Security / Cryptography / RSAOAEPKeyExchangeDeformatter.cs / 1 / RSAOAEPKeyExchangeDeformatter.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== namespace System.Security.Cryptography { [System.Runtime.InteropServices.ComVisible(true)] public class RSAOAEPKeyExchangeDeformatter : AsymmetricKeyExchangeDeformatter { private RSA _rsaKey; // RSA Key value to do decrypt operation // // public constructors // public RSAOAEPKeyExchangeDeformatter() {} public RSAOAEPKeyExchangeDeformatter(AsymmetricAlgorithm key) { if (key == null) throw new ArgumentNullException("key"); _rsaKey = (RSA) key; } // // public properties // public override String Parameters { get { return null; } set { ; } } // // public methods // public override byte[] DecryptKeyExchange(byte[] rgbData) { if (_rsaKey == null) throw new CryptographicUnexpectedOperationException(Environment.GetResourceString("Cryptography_MissingKey")); if (_rsaKey is RSACryptoServiceProvider) { return ((RSACryptoServiceProvider) _rsaKey).Decrypt(rgbData, true); } else { return Utils.RsaOaepDecrypt(_rsaKey, SHA1.Create(), new PKCS1MaskGenerationMethod(), rgbData); } } public override void SetKey(AsymmetricAlgorithm key) { if (key == null) throw new ArgumentNullException("key"); _rsaKey = (RSA) key; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== namespace System.Security.Cryptography { [System.Runtime.InteropServices.ComVisible(true)] public class RSAOAEPKeyExchangeDeformatter : AsymmetricKeyExchangeDeformatter { private RSA _rsaKey; // RSA Key value to do decrypt operation // // public constructors // public RSAOAEPKeyExchangeDeformatter() {} public RSAOAEPKeyExchangeDeformatter(AsymmetricAlgorithm key) { if (key == null) throw new ArgumentNullException("key"); _rsaKey = (RSA) key; } // // public properties // public override String Parameters { get { return null; } set { ; } } // // public methods // public override byte[] DecryptKeyExchange(byte[] rgbData) { if (_rsaKey == null) throw new CryptographicUnexpectedOperationException(Environment.GetResourceString("Cryptography_MissingKey")); if (_rsaKey is RSACryptoServiceProvider) { return ((RSACryptoServiceProvider) _rsaKey).Decrypt(rgbData, true); } else { return Utils.RsaOaepDecrypt(_rsaKey, SHA1.Create(), new PKCS1MaskGenerationMethod(), rgbData); } } public override void SetKey(AsymmetricAlgorithm key) { if (key == null) throw new ArgumentNullException("key"); _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
- Timeline.cs
- WindowsAuthenticationEventArgs.cs
- ModuleBuilder.cs
- ServiceChannelProxy.cs
- ToolboxItemAttribute.cs
- DataBinding.cs
- SuppressedPackageProperties.cs
- ADMembershipUser.cs
- UserNameSecurityTokenParameters.cs
- CursorInteropHelper.cs
- DataServiceQuery.cs
- TextRangeSerialization.cs
- XsltCompileContext.cs
- SafeViewOfFileHandle.cs
- SecureUICommand.cs
- ValidatedControlConverter.cs
- MobileControlsSection.cs
- CursorConverter.cs
- SmtpNetworkElement.cs
- FileDialogPermission.cs
- StateMachineAction.cs
- RemoteArgument.cs
- XmlSiteMapProvider.cs
- Merger.cs
- SubclassTypeValidatorAttribute.cs
- BindingFormattingDialog.cs
- WebScriptClientGenerator.cs
- DataGridColumnCollection.cs
- PriorityChain.cs
- QueryCacheEntry.cs
- ProfileEventArgs.cs
- LeaseManager.cs
- ReturnValue.cs
- FieldToken.cs
- PipelineModuleStepContainer.cs
- MemberPath.cs
- ListChangedEventArgs.cs
- baseaxisquery.cs
- VirtualizingPanel.cs
- TextTreeUndo.cs
- SettingsContext.cs
- DataColumnMappingCollection.cs
- XmlResolver.cs
- SQLDoubleStorage.cs
- PropertyGridEditorPart.cs
- CompositeScriptReferenceEventArgs.cs
- BufferModeSettings.cs
- XmlCharType.cs
- DBDataPermission.cs
- BuildProviderAppliesToAttribute.cs
- DirectoryNotFoundException.cs
- TableLayoutSettings.cs
- MemoryMappedViewStream.cs
- ToolStripSeparator.cs
- CommandID.cs
- SystemDiagnosticsSection.cs
- XmlMemberMapping.cs
- FlowPanelDesigner.cs
- DESCryptoServiceProvider.cs
- WebAdminConfigurationHelper.cs
- DesignerHierarchicalDataSourceView.cs
- TriggerActionCollection.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- TraceContextRecord.cs
- ToolZone.cs
- QilGeneratorEnv.cs
- XPathSelfQuery.cs
- FastEncoderWindow.cs
- LocalClientSecuritySettings.cs
- Assert.cs
- WebPartDeleteVerb.cs
- webclient.cs
- Exceptions.cs
- SyndicationSerializer.cs
- Classification.cs
- PersonalizationStateInfoCollection.cs
- TypeConverterValueSerializer.cs
- __FastResourceComparer.cs
- TreeViewCancelEvent.cs
- EvidenceBase.cs
- WindowsUpDown.cs
- GPPOINTF.cs
- PagesChangedEventArgs.cs
- CacheOutputQuery.cs
- MimeFormatter.cs
- SqlMethodTransformer.cs
- DocumentPageViewAutomationPeer.cs
- ObjectDataSourceEventArgs.cs
- TraceHandler.cs
- MenuRendererClassic.cs
- PrivateFontCollection.cs
- ReadOnlyDictionary.cs
- DesignerLoader.cs
- TypeBuilder.cs
- PairComparer.cs
- DiscoveryMessageSequenceCD1.cs
- ParameterToken.cs
- HotSpotCollection.cs
- TextWriter.cs
- CallbackDebugBehavior.cs