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
- WindowsIPAddress.cs
- DataGridViewLinkColumn.cs
- XmlIncludeAttribute.cs
- SafeRightsManagementHandle.cs
- DirectionalLight.cs
- EntityTransaction.cs
- FormattedTextSymbols.cs
- CodeNamespaceImport.cs
- DotExpr.cs
- PageAdapter.cs
- InputChannelAcceptor.cs
- ListChunk.cs
- DeadCharTextComposition.cs
- RepeatButtonAutomationPeer.cs
- StorageMappingItemCollection.cs
- EncodedStreamFactory.cs
- _HeaderInfoTable.cs
- MinimizableAttributeTypeConverter.cs
- MarkupExtensionSerializer.cs
- ResourceDictionary.cs
- HtmlTable.cs
- LockCookie.cs
- RemoteWebConfigurationHostServer.cs
- HttpCookiesSection.cs
- CustomErrorsSection.cs
- CalculatedColumn.cs
- LayeredChannelFactory.cs
- WindowsTokenRoleProvider.cs
- ToolStripOverflowButton.cs
- SecurityTokenSerializer.cs
- Int16.cs
- TraceUtility.cs
- DataRelationCollection.cs
- CodeStatementCollection.cs
- Quad.cs
- WindowAutomationPeer.cs
- ObjectDataSourceDisposingEventArgs.cs
- WorkflowApplicationAbortedEventArgs.cs
- WindowsBrush.cs
- BufferedReadStream.cs
- ImageFormat.cs
- BindingExpressionBase.cs
- VisualBasicImportReference.cs
- ModelUIElement3D.cs
- XmlSchemaAttribute.cs
- CacheAxisQuery.cs
- EventRouteFactory.cs
- Icon.cs
- SourceChangedEventArgs.cs
- KerberosRequestorSecurityTokenAuthenticator.cs
- login.cs
- __ConsoleStream.cs
- PeerName.cs
- XmlUtf8RawTextWriter.cs
- AmbientValueAttribute.cs
- StrokeNodeOperations.cs
- QilGenerator.cs
- CustomError.cs
- SchemaImporter.cs
- DataGridItemCollection.cs
- HtmlEmptyTagControlBuilder.cs
- KeyboardDevice.cs
- HttpBrowserCapabilitiesWrapper.cs
- RuleRefElement.cs
- PathHelper.cs
- RelatedPropertyManager.cs
- ThemeDictionaryExtension.cs
- MergeLocalizationDirectives.cs
- TreeWalkHelper.cs
- PointCollection.cs
- MessageQueueCriteria.cs
- ParallelSeparator.xaml.cs
- PeerCollaborationPermission.cs
- BidOverLoads.cs
- ActionFrame.cs
- InputScopeConverter.cs
- CfgParser.cs
- MappingItemCollection.cs
- AncillaryOps.cs
- SemanticValue.cs
- ChannelEndpointElement.cs
- TraceHandlerErrorFormatter.cs
- util.cs
- LookupNode.cs
- EllipticalNodeOperations.cs
- ExtractedStateEntry.cs
- SimpleHandlerBuildProvider.cs
- XmlComplianceUtil.cs
- ModulesEntry.cs
- WebSysDisplayNameAttribute.cs
- IFlowDocumentViewer.cs
- EventManager.cs
- TransformGroup.cs
- IgnoreSectionHandler.cs
- ComponentDispatcherThread.cs
- BindingSource.cs
- SmiContext.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- MailMessage.cs
- EncodingTable.cs