Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / infocard / Client / System / IdentityModel / Selectors / InfoCardRSAOAEPKeyExchangeFormatter.cs / 1305376 / InfoCardRSAOAEPKeyExchangeFormatter.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.IdentityModel.Selectors { using System; using System.Security.Cryptography; internal class InfoCardRSAOAEPKeyExchangeFormatter : RSAOAEPKeyExchangeFormatter { private RSA m_rsaKey; // // public constructors // public InfoCardRSAOAEPKeyExchangeFormatter() : base() {} public InfoCardRSAOAEPKeyExchangeFormatter( AsymmetricAlgorithm key ) : base( key ) { m_rsaKey = (RSA) key; } // // public methods // public override void SetKey( AsymmetricAlgorithm key ) { base.SetKey( key ); m_rsaKey = (RSA) key; } public override byte[] CreateKeyExchange( byte[] rgbData ) { if ( null != m_rsaKey && m_rsaKey is InfoCardRSACryptoProvider) { return ((InfoCardRSACryptoProvider) m_rsaKey).Encrypt(rgbData, true); } else { return base.CreateKeyExchange( rgbData ); } } } } // 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 InfoCardRSAOAEPKeyExchangeFormatter : RSAOAEPKeyExchangeFormatter { private RSA m_rsaKey; // // public constructors // public InfoCardRSAOAEPKeyExchangeFormatter() : base() {} public InfoCardRSAOAEPKeyExchangeFormatter( AsymmetricAlgorithm key ) : base( key ) { m_rsaKey = (RSA) key; } // // public methods // public override void SetKey( AsymmetricAlgorithm key ) { base.SetKey( key ); m_rsaKey = (RSA) key; } public override byte[] CreateKeyExchange( byte[] rgbData ) { if ( null != m_rsaKey && m_rsaKey is InfoCardRSACryptoProvider) { return ((InfoCardRSACryptoProvider) m_rsaKey).Encrypt(rgbData, true); } else { return base.CreateKeyExchange( rgbData ); } } } } // 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
- PriorityRange.cs
- LinkButton.cs
- FontConverter.cs
- SpellerInterop.cs
- MachineSettingsSection.cs
- Parsers.cs
- LogStore.cs
- PlainXmlWriter.cs
- ConfigXmlDocument.cs
- CompilationLock.cs
- DataGridState.cs
- DataGridPageChangedEventArgs.cs
- HighContrastHelper.cs
- Internal.cs
- AsymmetricSecurityProtocolFactory.cs
- PropertyGrid.cs
- Console.cs
- TableLayoutStyleCollection.cs
- XmlJsonReader.cs
- Bezier.cs
- IndexExpression.cs
- TagPrefixAttribute.cs
- PeerNameResolver.cs
- GeneratedCodeAttribute.cs
- HttpCapabilitiesEvaluator.cs
- AutomationElementCollection.cs
- StringDictionaryEditor.cs
- BaseDataListComponentEditor.cs
- ExtentJoinTreeNode.cs
- ClientTarget.cs
- MultiByteCodec.cs
- SizeConverter.cs
- PropertyDescriptorComparer.cs
- CodeDomConfigurationHandler.cs
- AstTree.cs
- Overlapped.cs
- PropertyTab.cs
- CodeConditionStatement.cs
- DrawingContext.cs
- PageContentCollection.cs
- UnsafeNativeMethodsCLR.cs
- ResourcePart.cs
- ReplyAdapterChannelListener.cs
- SqlLiftIndependentRowExpressions.cs
- WindowsListViewSubItem.cs
- ProcessModule.cs
- IISUnsafeMethods.cs
- WebScriptEnablingBehavior.cs
- ConsoleKeyInfo.cs
- OutputCacheSettingsSection.cs
- TextLineResult.cs
- SegmentInfo.cs
- NullRuntimeConfig.cs
- XMLDiffLoader.cs
- CodeDefaultValueExpression.cs
- TextProperties.cs
- DataServiceHost.cs
- ValidatorCollection.cs
- SqlDataSourceView.cs
- EnumBuilder.cs
- _PooledStream.cs
- TimersDescriptionAttribute.cs
- SettingsContext.cs
- VideoDrawing.cs
- BamlRecordWriter.cs
- ArcSegment.cs
- ScrollItemPatternIdentifiers.cs
- DataBoundControlActionList.cs
- ConstraintEnumerator.cs
- Ipv6Element.cs
- TraceUtility.cs
- UInt64Converter.cs
- CounterSetInstance.cs
- PartialCachingAttribute.cs
- BuilderInfo.cs
- TextEndOfSegment.cs
- ToolStripPanelRow.cs
- IconEditor.cs
- ItemsChangedEventArgs.cs
- ReaderWriterLock.cs
- ToolStripDropDownButton.cs
- Regex.cs
- SystemColorTracker.cs
- ServiceElement.cs
- RuntimeConfigLKG.cs
- CollectionViewSource.cs
- InplaceBitmapMetadataWriter.cs
- BindableAttribute.cs
- StaticExtension.cs
- NameValueConfigurationCollection.cs
- _DomainName.cs
- DependencyPropertyAttribute.cs
- SiteMap.cs
- BaseTemplateBuildProvider.cs
- UpDownBase.cs
- SystemIcmpV6Statistics.cs
- CodeIndexerExpression.cs
- DesignerLinkAdapter.cs
- AuthorizationSection.cs
- HtmlDocument.cs