Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / infocard / Client / System / IdentityModel / Selectors / InfoCardRSAOAEPKeyExchangeDeformatter.cs / 1305376 / InfoCardRSAOAEPKeyExchangeDeformatter.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.IdentityModel.Selectors { using System; using System.Security.Cryptography; internal class InfoCardRSAOAEPKeyExchangeDeformatter : RSAOAEPKeyExchangeDeformatter { private RSA m_rsaKey; // RSA Key value to do decrypt operation // // public constructors // public InfoCardRSAOAEPKeyExchangeDeformatter() : base() {} public InfoCardRSAOAEPKeyExchangeDeformatter( AsymmetricAlgorithm key ) : base( key ) { m_rsaKey = (RSA) key; } // // public methods // public override byte[] DecryptKeyExchange( byte[] rgbData ) { if ( null != m_rsaKey && m_rsaKey is InfoCardRSACryptoProvider ) { return ((InfoCardRSACryptoProvider) m_rsaKey).Decrypt( rgbData, true ); } else { return base.DecryptKeyExchange( rgbData ); } } public override void SetKey( AsymmetricAlgorithm key ) { base.SetKey( key ); m_rsaKey = (RSA) key; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.IdentityModel.Selectors { using System; using System.Security.Cryptography; internal class InfoCardRSAOAEPKeyExchangeDeformatter : RSAOAEPKeyExchangeDeformatter { private RSA m_rsaKey; // RSA Key value to do decrypt operation // // public constructors // public InfoCardRSAOAEPKeyExchangeDeformatter() : base() {} public InfoCardRSAOAEPKeyExchangeDeformatter( AsymmetricAlgorithm key ) : base( key ) { m_rsaKey = (RSA) key; } // // public methods // public override byte[] DecryptKeyExchange( byte[] rgbData ) { if ( null != m_rsaKey && m_rsaKey is InfoCardRSACryptoProvider ) { return ((InfoCardRSACryptoProvider) m_rsaKey).Decrypt( rgbData, true ); } else { return base.DecryptKeyExchange( rgbData ); } } public override void SetKey( AsymmetricAlgorithm key ) { base.SetKey( key ); m_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
- RC2.cs
- CodeCommentStatementCollection.cs
- SqlGenericUtil.cs
- ListViewCancelEventArgs.cs
- Image.cs
- ValueQuery.cs
- ConfigPathUtility.cs
- LinqDataSourceHelper.cs
- HttpMethodAttribute.cs
- DivideByZeroException.cs
- DesignerListAdapter.cs
- _HeaderInfo.cs
- _ScatterGatherBuffers.cs
- PropertyCollection.cs
- CodeDirectiveCollection.cs
- ReferencedAssembly.cs
- ZipPackagePart.cs
- DelegateArgumentValue.cs
- NetworkInterface.cs
- RepeaterItemCollection.cs
- EmptyQuery.cs
- PolicyValidationException.cs
- GetPageNumberCompletedEventArgs.cs
- ObjectStorage.cs
- DescendantQuery.cs
- XmlLinkedNode.cs
- GetFileNameResult.cs
- TextSelectionHelper.cs
- SmiMetaDataProperty.cs
- EmptyStringExpandableObjectConverter.cs
- TableStyle.cs
- FragmentQueryProcessor.cs
- StateRuntime.cs
- DataGridViewColumnStateChangedEventArgs.cs
- PersistChildrenAttribute.cs
- RegistryExceptionHelper.cs
- Convert.cs
- SmtpDigestAuthenticationModule.cs
- XPathNodeInfoAtom.cs
- ISCIIEncoding.cs
- XPathPatternBuilder.cs
- EnumValidator.cs
- SafeBitVector32.cs
- MarshalByRefObject.cs
- TypographyProperties.cs
- DesignTimeParseData.cs
- PrintingPermissionAttribute.cs
- wgx_commands.cs
- ProtocolsConfigurationHandler.cs
- CorrelationScope.cs
- RectAnimationClockResource.cs
- SchemaNotation.cs
- WindowsStatusBar.cs
- MgmtConfigurationRecord.cs
- ReadOnlyHierarchicalDataSource.cs
- DelegateSerializationHolder.cs
- GeneralTransform3DTo2D.cs
- AudioSignalProblemOccurredEventArgs.cs
- WsatEtwTraceListener.cs
- InternalControlCollection.cs
- TreeViewEvent.cs
- TextParentUndoUnit.cs
- WebControl.cs
- EventLogEntryCollection.cs
- PropertyGeneratedEventArgs.cs
- MatrixKeyFrameCollection.cs
- SQLByteStorage.cs
- Enlistment.cs
- Environment.cs
- ColorTransformHelper.cs
- PackUriHelper.cs
- Helpers.cs
- DependencyObjectValidator.cs
- ActionFrame.cs
- RequestQueryProcessor.cs
- ConfigXmlElement.cs
- DesignerSerializationVisibilityAttribute.cs
- XmlDataSourceNodeDescriptor.cs
- _KerberosClient.cs
- _DomainName.cs
- HyperLinkStyle.cs
- GrammarBuilderRuleRef.cs
- NamedPipeProcessProtocolHandler.cs
- FileStream.cs
- BufferedReadStream.cs
- TransportReplyChannelAcceptor.cs
- DoubleAnimationUsingKeyFrames.cs
- WindowsListViewGroupHelper.cs
- SerialErrors.cs
- Attribute.cs
- MutexSecurity.cs
- ThicknessAnimationBase.cs
- DebugViewWriter.cs
- PersonalizationAdministration.cs
- EmbeddedObject.cs
- AssemblyInfo.cs
- Freezable.cs
- odbcmetadatacollectionnames.cs
- MetaType.cs
- OleDbRowUpdatedEvent.cs