Code:
/ 4.0 / 4.0 / 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. 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
- HttpConfigurationContext.cs
- XmlDataLoader.cs
- EntityDataSourceSelectingEventArgs.cs
- ExpandSegmentCollection.cs
- Bits.cs
- ToolStripLocationCancelEventArgs.cs
- SecurityContextSecurityTokenParameters.cs
- Array.cs
- CornerRadius.cs
- UpdateCompiler.cs
- WebConfigurationHostFileChange.cs
- WebSysDescriptionAttribute.cs
- PartialList.cs
- WorkItem.cs
- ChineseLunisolarCalendar.cs
- ReadOnlyDataSource.cs
- XmlSchemaSimpleContent.cs
- EditingCommands.cs
- FlowDocumentPageViewerAutomationPeer.cs
- GlyphInfoList.cs
- Lease.cs
- Accessible.cs
- XamlPathDataSerializer.cs
- XmlStreamedByteStreamReader.cs
- DefaultPrintController.cs
- ObjectViewFactory.cs
- PngBitmapDecoder.cs
- RealizationDrawingContextWalker.cs
- BaseParser.cs
- TimelineGroup.cs
- SerializerDescriptor.cs
- GridViewDeletedEventArgs.cs
- SqlCaseSimplifier.cs
- StatusBar.cs
- MenuEventArgs.cs
- HwndTarget.cs
- FileDialogCustomPlacesCollection.cs
- XmlDataLoader.cs
- DbParameterCollectionHelper.cs
- WebFormsRootDesigner.cs
- DiscoveryReference.cs
- BindingExpressionUncommonField.cs
- NavigationFailedEventArgs.cs
- Baml2006ReaderSettings.cs
- Evaluator.cs
- DataListItemCollection.cs
- ElementProxy.cs
- Utility.cs
- SerializerWriterEventHandlers.cs
- CodeGen.cs
- ScrollContentPresenter.cs
- HttpModuleAction.cs
- BuildProvider.cs
- DodSequenceMerge.cs
- Label.cs
- NativeMethods.cs
- Models.cs
- NameValueSectionHandler.cs
- ViewStateException.cs
- ProxyWebPartConnectionCollection.cs
- DynamicDocumentPaginator.cs
- HandlerBase.cs
- ColumnMapVisitor.cs
- HttpListenerException.cs
- XmlDocumentType.cs
- ErrorEventArgs.cs
- MarginCollapsingState.cs
- IHttpResponseInternal.cs
- TimeSpanOrInfiniteConverter.cs
- ValidatorUtils.cs
- MessageHeaderInfoTraceRecord.cs
- SqlCacheDependencyDatabase.cs
- PictureBoxDesigner.cs
- ClientApiGenerator.cs
- OleDbStruct.cs
- GridEntryCollection.cs
- XmlSecureResolver.cs
- PrePostDescendentsWalker.cs
- ProtocolsConfiguration.cs
- DataContractSerializerOperationGenerator.cs
- _ListenerAsyncResult.cs
- FunctionCommandText.cs
- PathSegmentCollection.cs
- RegistryKey.cs
- InputProcessorProfilesLoader.cs
- TextDocumentView.cs
- SqlReorderer.cs
- ModifiableIteratorCollection.cs
- LifetimeServices.cs
- Context.cs
- DataGridViewCellPaintingEventArgs.cs
- Transform.cs
- DPAPIProtectedConfigurationProvider.cs
- RegexParser.cs
- DictionaryContent.cs
- WebPartDeleteVerb.cs
- SqlDataSourceCommandEventArgs.cs
- CLRBindingWorker.cs
- CTreeGenerator.cs
- CodeMethodReturnStatement.cs