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
- RangeContentEnumerator.cs
- Logging.cs
- XmlSchemaComplexContentExtension.cs
- DataContractSerializerServiceBehavior.cs
- HandleExceptionArgs.cs
- ConfigurationProviderException.cs
- Vars.cs
- documentsequencetextview.cs
- AnimationClockResource.cs
- XmlImplementation.cs
- CollectionViewSource.cs
- SatelliteContractVersionAttribute.cs
- HTTPNotFoundHandler.cs
- RelatedCurrencyManager.cs
- DodSequenceMerge.cs
- manifestimages.cs
- HostedHttpContext.cs
- HtmlToClrEventProxy.cs
- EventHandlerList.cs
- TrustManager.cs
- SplineKeyFrames.cs
- ValidationHelper.cs
- WebPartZone.cs
- FormViewDeletedEventArgs.cs
- FloaterParaClient.cs
- NonVisualControlAttribute.cs
- WizardStepBase.cs
- PersonalizationEntry.cs
- SchemaType.cs
- PauseStoryboard.cs
- TypographyProperties.cs
- TypeUnloadedException.cs
- SQLUtility.cs
- XmlElementAttribute.cs
- DataGridViewRowsAddedEventArgs.cs
- MobileContainerDesigner.cs
- Duration.cs
- MulticastDelegate.cs
- IChannel.cs
- SettingsPropertyCollection.cs
- SmiContext.cs
- NetCodeGroup.cs
- SchemaAttDef.cs
- ProtocolsConfiguration.cs
- MemberInfoSerializationHolder.cs
- ToolboxComponentsCreatingEventArgs.cs
- HtmlTableCellCollection.cs
- XPathNodeList.cs
- RC2CryptoServiceProvider.cs
- __FastResourceComparer.cs
- XmlSchemaCompilationSettings.cs
- FontStyles.cs
- QueryStringParameter.cs
- CounterSample.cs
- safePerfProviderHandle.cs
- EncoderBestFitFallback.cs
- PolyBezierSegment.cs
- PostBackTrigger.cs
- QuaternionAnimationBase.cs
- ExpandCollapseProviderWrapper.cs
- LoadRetryAsyncResult.cs
- CounterCreationDataCollection.cs
- BuildProviderAppliesToAttribute.cs
- ClonableStack.cs
- ClientSession.cs
- CommonObjectSecurity.cs
- RuntimeArgumentHandle.cs
- UnmanagedMemoryStream.cs
- SQLInt64.cs
- SecurityTokenReferenceStyle.cs
- TextWriter.cs
- BackStopAuthenticationModule.cs
- ParagraphResult.cs
- CharConverter.cs
- DependencyPropertyKey.cs
- ConnectionStringsExpressionBuilder.cs
- CodeAttributeDeclaration.cs
- DelegatingMessage.cs
- EntityContainerEntitySet.cs
- ContextMenuStripActionList.cs
- ProvidePropertyAttribute.cs
- ViewKeyConstraint.cs
- SqlNodeAnnotation.cs
- __Filters.cs
- URLMembershipCondition.cs
- AttributeData.cs
- RectangleConverter.cs
- JpegBitmapEncoder.cs
- SqlClientWrapperSmiStreamChars.cs
- RawKeyboardInputReport.cs
- FusionWrap.cs
- LinqDataSourceEditData.cs
- FaultPropagationRecord.cs
- RegexGroupCollection.cs
- QueryCacheKey.cs
- OneToOneMappingSerializer.cs
- ManifestSignatureInformation.cs
- SemaphoreSecurity.cs
- AttributeProviderAttribute.cs
- ContractMapping.cs