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
- NumericUpDown.cs
- OrthographicCamera.cs
- EncryptedHeader.cs
- Light.cs
- ParseElement.cs
- RadialGradientBrush.cs
- IteratorAsyncResult.cs
- TextDecoration.cs
- BitmapFrameEncode.cs
- ColumnCollectionEditor.cs
- ExceptionUtil.cs
- EndPoint.cs
- HebrewNumber.cs
- CaseExpr.cs
- XmlNodeChangedEventArgs.cs
- TimeZone.cs
- DataGridViewCellValueEventArgs.cs
- NullableIntMinMaxAggregationOperator.cs
- ParamArrayAttribute.cs
- LifetimeServices.cs
- XmlTypeAttribute.cs
- FilteredAttributeCollection.cs
- CheckBoxAutomationPeer.cs
- Point3D.cs
- ActivityCodeDomReferenceService.cs
- serverconfig.cs
- Panel.cs
- TextDecoration.cs
- DragStartedEventArgs.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- ValidationErrorEventArgs.cs
- FreezableDefaultValueFactory.cs
- JavaScriptObjectDeserializer.cs
- AsyncStreamReader.cs
- GlyphRun.cs
- SimpleType.cs
- TypeConverterAttribute.cs
- ConnectionProviderAttribute.cs
- UnaryQueryOperator.cs
- LabelLiteral.cs
- BaseValidator.cs
- XmlElementAttribute.cs
- JapaneseCalendar.cs
- _FtpControlStream.cs
- DbMetaDataColumnNames.cs
- EntityModelBuildProvider.cs
- FolderBrowserDialog.cs
- FixedBufferAttribute.cs
- XmlSchemaSimpleContentRestriction.cs
- TraceContextEventArgs.cs
- TextRangeEditLists.cs
- ServiceManager.cs
- PathGeometry.cs
- LessThan.cs
- LicenseManager.cs
- BindingContext.cs
- EntityCollection.cs
- Point3D.cs
- Image.cs
- XmlConvert.cs
- WhitespaceRuleLookup.cs
- Separator.cs
- Pen.cs
- SecureConversationDriver.cs
- ProcessModuleCollection.cs
- MimeBasePart.cs
- SelectionProviderWrapper.cs
- CaseStatement.cs
- UrlMappingsSection.cs
- KerberosTicketHashIdentifierClause.cs
- Fonts.cs
- CultureTable.cs
- Misc.cs
- PenThreadWorker.cs
- StreamSecurityUpgradeInitiatorBase.cs
- OleDbDataAdapter.cs
- CapabilitiesSection.cs
- SettingsPropertyWrongTypeException.cs
- SqlExpressionNullability.cs
- Size3D.cs
- Message.cs
- SafeReadContext.cs
- CommonGetThemePartSize.cs
- Polyline.cs
- OdbcRowUpdatingEvent.cs
- ToolStrip.cs
- CultureInfoConverter.cs
- Empty.cs
- GroupByQueryOperator.cs
- processwaithandle.cs
- ExpandableObjectConverter.cs
- CompModSwitches.cs
- TextServicesCompartmentEventSink.cs
- GeometryDrawing.cs
- TemplateNodeContextMenu.cs
- AsyncOperation.cs
- XamlSerializerUtil.cs
- XPathNodeList.cs
- SessionStateModule.cs
- ThemeDirectoryCompiler.cs