Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- basenumberconverter.cs
- XmlComment.cs
- ExtenderProviderService.cs
- ItemAutomationPeer.cs
- OrCondition.cs
- ResourceDictionaryCollection.cs
- HandledEventArgs.cs
- RoleGroupCollectionEditor.cs
- StickyNoteContentControl.cs
- FlowLayoutSettings.cs
- StrongNamePublicKeyBlob.cs
- KeyGestureValueSerializer.cs
- Stack.cs
- BamlTreeMap.cs
- DataSourceSelectArguments.cs
- JpegBitmapDecoder.cs
- Formatter.cs
- PointHitTestResult.cs
- MatrixCamera.cs
- GlobalizationAssembly.cs
- ObjectConverter.cs
- NestedContainer.cs
- MemberInfoSerializationHolder.cs
- AlternateViewCollection.cs
- IOThreadTimer.cs
- SignatureHelper.cs
- ListDictionaryInternal.cs
- DataGridViewSelectedRowCollection.cs
- DataListItem.cs
- WebPartDescriptionCollection.cs
- Domain.cs
- DesignerEditorPartChrome.cs
- SecurityManager.cs
- ContractHandle.cs
- FileDocument.cs
- PropertyValueChangedEvent.cs
- UriTemplateVariablePathSegment.cs
- _Rfc2616CacheValidators.cs
- DataAccessor.cs
- ZipIOCentralDirectoryBlock.cs
- DocumentPageTextView.cs
- Util.cs
- RegexGroupCollection.cs
- XmlSignificantWhitespace.cs
- BindingEntityInfo.cs
- MetadataConversionError.cs
- ThicknessAnimationBase.cs
- DispatcherObject.cs
- MessageEventSubscriptionService.cs
- CalendarAutomationPeer.cs
- ArgumentDirectionHelper.cs
- DelegateArgumentReference.cs
- TreeViewHitTestInfo.cs
- XmlStrings.cs
- FunctionDescription.cs
- Thread.cs
- ComboBox.cs
- FloaterParagraph.cs
- ObjectNavigationPropertyMapping.cs
- CodeObject.cs
- WebPartConnection.cs
- DocumentCollection.cs
- NullableFloatMinMaxAggregationOperator.cs
- ArgIterator.cs
- EntityKey.cs
- ListViewSortEventArgs.cs
- MembershipAdapter.cs
- SiteMapPath.cs
- SamlAuthenticationStatement.cs
- WSFederationHttpSecurityMode.cs
- ArcSegment.cs
- HWStack.cs
- DataGridViewRowPostPaintEventArgs.cs
- QilLoop.cs
- BCLDebug.cs
- CodeAttachEventStatement.cs
- DeviceSpecificChoice.cs
- ValidatedControlConverter.cs
- WebContext.cs
- ChannelEndpointElementCollection.cs
- PageFunction.cs
- DataTableTypeConverter.cs
- TimeSpanMinutesConverter.cs
- COM2ExtendedBrowsingHandler.cs
- AuthenticateEventArgs.cs
- OrderByBuilder.cs
- ControlsConfig.cs
- BitmapVisualManager.cs
- RemoteWebConfigurationHostServer.cs
- XmlWriterSettings.cs
- NavigationPropertyEmitter.cs
- HtmlGenericControl.cs
- DependencyProperty.cs
- BufferedMessageWriter.cs
- RawStylusSystemGestureInputReport.cs
- RegexCompiler.cs
- InheritablePropertyChangeInfo.cs
- DataGridView.cs
- OSFeature.cs
- CTreeGenerator.cs