Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Security / Cryptography / RSAOAEPKeyExchangeDeformatter.cs / 1305376 / RSAOAEPKeyExchangeDeformatter.cs
using System.Diagnostics.Contracts; // ==++== // // 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"); Contract.EndContractBlock(); _rsaKey = (RSA) key; } // // public properties // public override String Parameters { get { return null; } set { ; } } // // public methods // [System.Security.SecuritySafeCritical] // auto-generated 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"); Contract.EndContractBlock(); _rsaKey = (RSA) key; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Interlocked.cs
- OutKeywords.cs
- util.cs
- BulletChrome.cs
- ProcessingInstructionAction.cs
- DropSource.cs
- SendMessageRecord.cs
- RequestStatusBarUpdateEventArgs.cs
- PartitionResolver.cs
- HtmlEncodedRawTextWriter.cs
- GPPOINTF.cs
- WebPageTraceListener.cs
- LinkClickEvent.cs
- XmlElementAttributes.cs
- JsonUriDataContract.cs
- SafeMemoryMappedViewHandle.cs
- KeyEvent.cs
- RegexMatchCollection.cs
- sqlinternaltransaction.cs
- ObjectMaterializedEventArgs.cs
- DataGridViewComboBoxColumn.cs
- HandleCollector.cs
- DataRowComparer.cs
- WebBrowsableAttribute.cs
- AutoGeneratedField.cs
- SoapFaultCodes.cs
- PreviewPrintController.cs
- HostProtectionPermission.cs
- PrintDialog.cs
- BaseUriHelper.cs
- EventManager.cs
- SynchronizedDispatch.cs
- DataGridViewTopRowAccessibleObject.cs
- XmlSchemaObjectCollection.cs
- TemplateBamlRecordReader.cs
- HeaderCollection.cs
- FormsAuthenticationUserCollection.cs
- WsatServiceAddress.cs
- WinFormsComponentEditor.cs
- NativeMethods.cs
- NameTable.cs
- Table.cs
- InternalMappingException.cs
- XmlFormatExtensionPrefixAttribute.cs
- Root.cs
- FontUnit.cs
- SchemaTableOptionalColumn.cs
- TailCallAnalyzer.cs
- FreezableOperations.cs
- DataBoundControlDesigner.cs
- Pointer.cs
- ValidationSummary.cs
- ToolStripLabel.cs
- EncodedStreamFactory.cs
- MissingManifestResourceException.cs
- PropertyRef.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- BitArray.cs
- SqlDataRecord.cs
- DataSourceCache.cs
- FormatException.cs
- CheckBoxStandardAdapter.cs
- DropSource.cs
- log.cs
- ServiceHttpHandlerFactory.cs
- HttpProxyTransportBindingElement.cs
- WSSecurityPolicy11.cs
- CodeBinaryOperatorExpression.cs
- ContainerUIElement3D.cs
- ChangeProcessor.cs
- ClosureBinding.cs
- ViewCellRelation.cs
- AvTraceDetails.cs
- UIElementCollection.cs
- InvalidContentTypeException.cs
- CommandLibraryHelper.cs
- RadioButtonStandardAdapter.cs
- SqlStream.cs
- IteratorFilter.cs
- PersonalizablePropertyEntry.cs
- BaseTreeIterator.cs
- ConnectivityStatus.cs
- XmlQualifiedName.cs
- SQLBytesStorage.cs
- PermissionSet.cs
- AsyncStreamReader.cs
- XPathItem.cs
- DataGridViewCellMouseEventArgs.cs
- InkCanvas.cs
- StructuralCache.cs
- VarRefManager.cs
- MulticastNotSupportedException.cs
- BoundColumn.cs
- BinaryFormatterWriter.cs
- MDIClient.cs
- EndpointInfoCollection.cs
- VirtualDirectoryMapping.cs
- SessionEndedEventArgs.cs
- BitVector32.cs
- ToolStripPanelRenderEventArgs.cs