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
- SimpleHandlerBuildProvider.cs
- MbpInfo.cs
- ProjectionPruner.cs
- PeerNodeAddress.cs
- WebPartEditorApplyVerb.cs
- WindowsEditBox.cs
- WCFServiceClientProxyGenerator.cs
- OracleParameter.cs
- LogReservationCollection.cs
- BigInt.cs
- Wizard.cs
- URI.cs
- ContextMenuStrip.cs
- GridLength.cs
- UnmanagedHandle.cs
- DuplicateWaitObjectException.cs
- RestHandler.cs
- DbMetaDataCollectionNames.cs
- PathNode.cs
- LOSFormatter.cs
- MTConfigUtil.cs
- EntityDataSourceSelectingEventArgs.cs
- TypeSemantics.cs
- SendReply.cs
- PublishLicense.cs
- NamespaceExpr.cs
- WebRequestModuleElementCollection.cs
- GenericEnumerator.cs
- MenuItemBinding.cs
- SystemIPInterfaceProperties.cs
- METAHEADER.cs
- SectionInput.cs
- FileDialogCustomPlacesCollection.cs
- RequestResizeEvent.cs
- RtType.cs
- QilGenerator.cs
- FlowDocumentPaginator.cs
- SecurityPermission.cs
- FtpWebResponse.cs
- ResourceDisplayNameAttribute.cs
- Point4D.cs
- ExpandCollapseProviderWrapper.cs
- BreakRecordTable.cs
- BoundField.cs
- HtmlAnchor.cs
- SqlConnectionFactory.cs
- WebBrowser.cs
- DataTemplateSelector.cs
- LayoutManager.cs
- CompiledRegexRunner.cs
- BindingList.cs
- TdsParserStaticMethods.cs
- transactioncontext.cs
- SapiInterop.cs
- FormatterConverter.cs
- WebPartCatalogAddVerb.cs
- WorkflowCommandExtensionItem.cs
- ListViewAutomationPeer.cs
- IPipelineRuntime.cs
- FormViewUpdatedEventArgs.cs
- PartitionedDataSource.cs
- ServiceDiscoveryElement.cs
- OneOfTypeConst.cs
- LOSFormatter.cs
- EncryptedPackage.cs
- SeekStoryboard.cs
- NativeMethods.cs
- LayoutTable.cs
- QilInvokeLateBound.cs
- SubtreeProcessor.cs
- PolicyStatement.cs
- FixedBufferAttribute.cs
- RepeaterItemEventArgs.cs
- FormParameter.cs
- PipeStream.cs
- XPSSignatureDefinition.cs
- BindingObserver.cs
- Funcletizer.cs
- LeaseManager.cs
- ServiceContractListItem.cs
- SqlUDTStorage.cs
- PinnedBufferMemoryStream.cs
- DesignerVerbCollection.cs
- ConnectionsZone.cs
- KeyGestureValueSerializer.cs
- AutoCompleteStringCollection.cs
- HierarchicalDataSourceControl.cs
- ValidationResult.cs
- DataControlPagerLinkButton.cs
- PartitionedStreamMerger.cs
- CodeDelegateCreateExpression.cs
- TableRow.cs
- ProcessModelInfo.cs
- HtmlElementEventArgs.cs
- DataGridViewCellValueEventArgs.cs
- CompareValidator.cs
- NumericPagerField.cs
- RuntimeHandles.cs
- EntityTypeEmitter.cs
- AdapterSwitches.cs