Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- TemplateKey.cs
- SafePointer.cs
- Encoder.cs
- XslTransform.cs
- HtmlInputControl.cs
- AlignmentYValidation.cs
- Figure.cs
- RangeBase.cs
- ContextConfiguration.cs
- UnmanagedMarshal.cs
- LogPolicy.cs
- ValueUnavailableException.cs
- DtdParser.cs
- LinqDataSourceView.cs
- InputMethodStateTypeInfo.cs
- ThemeDirectoryCompiler.cs
- ProtocolProfile.cs
- ObjectSpanRewriter.cs
- DictionaryMarkupSerializer.cs
- WebPartVerb.cs
- HTMLTagNameToTypeMapper.cs
- HttpRawResponse.cs
- Clock.cs
- NTAccount.cs
- OrderByBuilder.cs
- XmlDocumentViewSchema.cs
- Size.cs
- QilDataSource.cs
- PropertyBuilder.cs
- TypeConverterAttribute.cs
- BamlStream.cs
- SystemNetHelpers.cs
- XmlSerializationWriter.cs
- SettingsProviderCollection.cs
- BindingCompleteEventArgs.cs
- BaseResourcesBuildProvider.cs
- ModelTypeConverter.cs
- DataSourceHelper.cs
- AutomationElementCollection.cs
- TextEditorThreadLocalStore.cs
- ServiceBusyException.cs
- MenuItemBindingCollection.cs
- DtcInterfaces.cs
- ManipulationPivot.cs
- MobileComponentEditorPage.cs
- WasAdminWrapper.cs
- PropertyTabAttribute.cs
- URLIdentityPermission.cs
- ByteAnimation.cs
- ResourcePool.cs
- PathParser.cs
- controlskin.cs
- TemplateField.cs
- SchemaObjectWriter.cs
- TrimSurroundingWhitespaceAttribute.cs
- EncoderNLS.cs
- RoutedPropertyChangedEventArgs.cs
- FixedDSBuilder.cs
- QueryRewriter.cs
- ComAdminInterfaces.cs
- ToolStripPanel.cs
- DataGridCellEditEndingEventArgs.cs
- ChameleonKey.cs
- PassportIdentity.cs
- EntityCommand.cs
- PowerModeChangedEventArgs.cs
- Page.cs
- PropertyEmitter.cs
- CommandConverter.cs
- BitmapEffectRenderDataResource.cs
- ProfileService.cs
- TcpTransportManager.cs
- ContextInformation.cs
- ValidateNames.cs
- EditCommandColumn.cs
- RepeaterItemEventArgs.cs
- WindowsTokenRoleProvider.cs
- ContentElementCollection.cs
- DbConnectionStringCommon.cs
- XXXOnTypeBuilderInstantiation.cs
- SmtpDigestAuthenticationModule.cs
- MultiBindingExpression.cs
- DebugViewWriter.cs
- DomainUpDown.cs
- VisualTarget.cs
- BorderGapMaskConverter.cs
- SimpleLine.cs
- MdiWindowListItemConverter.cs
- Debug.cs
- HwndSourceKeyboardInputSite.cs
- XmlSerializationReader.cs
- GlobalizationAssembly.cs
- _AcceptOverlappedAsyncResult.cs
- ContentFileHelper.cs
- Monitor.cs
- SessionIDManager.cs
- CalloutQueueItem.cs
- PropertyPath.cs
- SmtpNegotiateAuthenticationModule.cs
- ReferencedCollectionType.cs