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
- Style.cs
- ClockController.cs
- UITypeEditor.cs
- ButtonFlatAdapter.cs
- DispatchChannelSink.cs
- ItemList.cs
- AddInController.cs
- DataStreamFromComStream.cs
- InternalCache.cs
- WebPartAddingEventArgs.cs
- MetadataItemEmitter.cs
- X509CertificateCollection.cs
- MetadataLocation.cs
- CodeTypeParameter.cs
- MailMessage.cs
- SessionViewState.cs
- RecognitionResult.cs
- SurrogateEncoder.cs
- SizeLimitedCache.cs
- MimeMapping.cs
- PriorityBindingExpression.cs
- ManagementObjectSearcher.cs
- SimpleTypesSurrogate.cs
- DecimalAnimationUsingKeyFrames.cs
- ResourceSetExpression.cs
- DynamicActivity.cs
- MailWebEventProvider.cs
- BitmapEffectGroup.cs
- SpeechEvent.cs
- XNodeSchemaApplier.cs
- HostVisual.cs
- TimelineGroup.cs
- SqlError.cs
- HttpContextBase.cs
- UrlMappingsSection.cs
- XsdCachingReader.cs
- ManipulationInertiaStartingEventArgs.cs
- SecurityDocument.cs
- XsdBuildProvider.cs
- Collection.cs
- CapabilitiesUse.cs
- COM2Properties.cs
- XmlTextReaderImpl.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- ListBoxDesigner.cs
- CultureInfoConverter.cs
- EntityObject.cs
- TreeNodeConverter.cs
- ViewPort3D.cs
- SelectionWordBreaker.cs
- DictionaryBase.cs
- IdSpace.cs
- KeyProperty.cs
- X509SecurityTokenAuthenticator.cs
- TextEditorThreadLocalStore.cs
- ViewStateException.cs
- Model3DCollection.cs
- WpfWebRequestHelper.cs
- Confirm.cs
- SqlSupersetValidator.cs
- EnumCodeDomSerializer.cs
- ProgressiveCrcCalculatingStream.cs
- TextServicesCompartmentContext.cs
- DataViewSettingCollection.cs
- Panel.cs
- MobileListItemCollection.cs
- BookmarkCallbackWrapper.cs
- CellPartitioner.cs
- SchemaNotation.cs
- OutputCacheProfileCollection.cs
- HMACMD5.cs
- OleDbException.cs
- DrawingServices.cs
- Wizard.cs
- ObjectDataSourceEventArgs.cs
- EntityContainerRelationshipSet.cs
- MetadataPropertyAttribute.cs
- Keyboard.cs
- WindowsSysHeader.cs
- Vector.cs
- FrugalList.cs
- TreeNode.cs
- AutomationPatternInfo.cs
- CodeExporter.cs
- SoapIncludeAttribute.cs
- MetabaseServerConfig.cs
- RenamedEventArgs.cs
- DocumentApplicationJournalEntry.cs
- CompositeFontFamily.cs
- IgnoreFileBuildProvider.cs
- TextEditorDragDrop.cs
- GenericWebPart.cs
- DataSvcMapFileSerializer.cs
- TypeResolvingOptions.cs
- EvidenceBase.cs
- DataErrorValidationRule.cs
- FormsAuthenticationCredentials.cs
- Lasso.cs
- ListParaClient.cs
- XamlPoint3DCollectionSerializer.cs