Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- CellQuery.cs
- WebBrowserBase.cs
- MetadataStore.cs
- ListViewHitTestInfo.cs
- DocumentEventArgs.cs
- NavigationWindow.cs
- ClientConfigPaths.cs
- InlineUIContainer.cs
- WindowsMenu.cs
- Expressions.cs
- ToolStripOverflowButton.cs
- DataReceivedEventArgs.cs
- OleDbFactory.cs
- ReturnEventArgs.cs
- BitmapEffectInput.cs
- TableLayoutSettingsTypeConverter.cs
- RefreshEventArgs.cs
- CFGGrammar.cs
- PageContentAsyncResult.cs
- EdmItemError.cs
- PrintingPermissionAttribute.cs
- StructuralCache.cs
- CalendarTable.cs
- EntityCommandExecutionException.cs
- CallbackTimeoutsElement.cs
- RuleSettingsCollection.cs
- DiscoveryOperationContext.cs
- InputLanguageProfileNotifySink.cs
- Lock.cs
- ToolStripLabel.cs
- HostProtectionException.cs
- CommandManager.cs
- DataPagerField.cs
- UriSection.cs
- TrustManagerPromptUI.cs
- OptimizerPatterns.cs
- DocumentViewerConstants.cs
- DbTransaction.cs
- DataGridCommandEventArgs.cs
- TemplateInstanceAttribute.cs
- SqlRowUpdatedEvent.cs
- WinFormsUtils.cs
- Selector.cs
- StreamGeometry.cs
- PreviewPageInfo.cs
- ObjectContext.cs
- FixedSOMLineCollection.cs
- Stylus.cs
- ProtocolsConfigurationEntry.cs
- ManifestResourceInfo.cs
- SqlConnectionFactory.cs
- JapaneseCalendar.cs
- VideoDrawing.cs
- UnsafeNativeMethods.cs
- ManagementDateTime.cs
- PKCS1MaskGenerationMethod.cs
- XamlValidatingReader.cs
- TypeListConverter.cs
- DBConnection.cs
- MimeBasePart.cs
- EntityPropertyMappingAttribute.cs
- BitmapEffect.cs
- RepeaterItemEventArgs.cs
- CodeDirectoryCompiler.cs
- Line.cs
- ClientSettingsSection.cs
- PrimitiveDataContract.cs
- RegexCompiler.cs
- DynamicPropertyHolder.cs
- InstancePersistenceCommand.cs
- SqlUnionizer.cs
- TemplateField.cs
- QueryResponse.cs
- Literal.cs
- TabPageDesigner.cs
- ObjectStateManager.cs
- DbException.cs
- SystemColors.cs
- CommandLibraryHelper.cs
- StyleSelector.cs
- BidPrivateBase.cs
- CodeBlockBuilder.cs
- SpeechUI.cs
- SmtpAuthenticationManager.cs
- VSWCFServiceContractGenerator.cs
- ProjectedSlot.cs
- QuotedPairReader.cs
- UserInitiatedNavigationPermission.cs
- ZipIOModeEnforcingStream.cs
- CodeBlockBuilder.cs
- BridgeDataReader.cs
- ComAwareEventInfo.cs
- IpcChannel.cs
- BitmapEffect.cs
- DependentList.cs
- ValidateNames.cs
- ConfigurationStrings.cs
- RuntimeArgumentHandle.cs
- XmlSchemaObjectCollection.cs
- SegmentInfo.cs