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
- XamlDebuggerXmlReader.cs
- CertificateReferenceElement.cs
- SweepDirectionValidation.cs
- HuffCodec.cs
- BrowserCapabilitiesCodeGenerator.cs
- recordstatescratchpad.cs
- TextMetrics.cs
- BuildProviderAppliesToAttribute.cs
- TiffBitmapDecoder.cs
- DataGridViewCellStyleEditor.cs
- DiscoveryDocumentLinksPattern.cs
- ConstraintEnumerator.cs
- XmlAttributeCollection.cs
- TableRowCollection.cs
- LoggedException.cs
- mongolianshape.cs
- ResourcePropertyMemberCodeDomSerializer.cs
- Rule.cs
- EntitySqlQueryCacheEntry.cs
- CqlGenerator.cs
- HttpWebResponse.cs
- AttributeEmitter.cs
- RtType.cs
- ToolBarButtonClickEvent.cs
- VisualBrush.cs
- ProcessInputEventArgs.cs
- PropertySourceInfo.cs
- MemoryRecordBuffer.cs
- ExpressionSelection.cs
- BlobPersonalizationState.cs
- FontUnitConverter.cs
- WindowsListViewItemCheckBox.cs
- CompileLiteralTextParser.cs
- ChtmlTextWriter.cs
- XmlSchemaInclude.cs
- CurrentTimeZone.cs
- JavaScriptObjectDeserializer.cs
- BitVector32.cs
- IdentityReference.cs
- DrawingVisual.cs
- ManipulationCompletedEventArgs.cs
- HasCopySemanticsAttribute.cs
- ProcessModelInfo.cs
- _NestedSingleAsyncResult.cs
- QuarticEase.cs
- UseAttributeSetsAction.cs
- OutputCacheProfile.cs
- ProtocolsSection.cs
- CryptoApi.cs
- SymbolMethod.cs
- EnumType.cs
- PropertyPushdownHelper.cs
- _HeaderInfoTable.cs
- ParameterToken.cs
- FindSimilarActivitiesVerb.cs
- CompareValidator.cs
- FormsAuthenticationCredentials.cs
- LazyInitializer.cs
- WorkflowWebService.cs
- TimeEnumHelper.cs
- XmlSortKey.cs
- XamlSerializerUtil.cs
- UnsafeMethods.cs
- Rotation3DAnimationBase.cs
- ListItemCollection.cs
- ProxyDataContractResolver.cs
- PatternMatcher.cs
- RawStylusInputReport.cs
- ActivityContext.cs
- CharacterMetricsDictionary.cs
- SmuggledIUnknown.cs
- DataTableClearEvent.cs
- Bits.cs
- ComplexBindingPropertiesAttribute.cs
- SqlFormatter.cs
- ComAdminWrapper.cs
- baseshape.cs
- ReflectionPermission.cs
- IntSumAggregationOperator.cs
- ProfileInfo.cs
- EventListenerClientSide.cs
- DataGridViewRowEventArgs.cs
- XsltOutput.cs
- WebPartDisplayModeCancelEventArgs.cs
- XmlEncodedRawTextWriter.cs
- HandlerFactoryCache.cs
- BuildProvider.cs
- CommandField.cs
- KnownColorTable.cs
- PeerCustomResolverSettings.cs
- StreamGeometry.cs
- ClientScriptManagerWrapper.cs
- MessageSecurityOverMsmq.cs
- DbDataSourceEnumerator.cs
- XmlSchemaIdentityConstraint.cs
- EditingCommands.cs
- TreeNodeEventArgs.cs
- ViewGenResults.cs
- TagNameToTypeMapper.cs
- ConfigXmlWhitespace.cs