Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / infocard / Client / System / IdentityModel / Selectors / InfoCardRSAPKCS1KeyExchangeFormatter.cs / 1305376 / InfoCardRSAPKCS1KeyExchangeFormatter.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.IdentityModel.Selectors { using System; using System.Security.Cryptography; internal class InfoCardRSAPKCS1KeyExchangeFormatter : RSAPKCS1KeyExchangeFormatter { RSA m_rsaKey; // // public constructors // public InfoCardRSAPKCS1KeyExchangeFormatter() : base() {} public InfoCardRSAPKCS1KeyExchangeFormatter(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, false); } 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 InfoCardRSAPKCS1KeyExchangeFormatter : RSAPKCS1KeyExchangeFormatter { RSA m_rsaKey; // // public constructors // public InfoCardRSAPKCS1KeyExchangeFormatter() : base() {} public InfoCardRSAPKCS1KeyExchangeFormatter(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, false); } 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
- GPRECTF.cs
- DateBoldEvent.cs
- UriExt.cs
- ProcessStartInfo.cs
- TableSectionStyle.cs
- VerticalAlignConverter.cs
- CounterCreationData.cs
- RubberbandSelector.cs
- SEHException.cs
- RepeaterCommandEventArgs.cs
- SchemaElementDecl.cs
- HostingEnvironmentException.cs
- IChannel.cs
- FormViewRow.cs
- QilInvokeEarlyBound.cs
- WebBrowserProgressChangedEventHandler.cs
- Int64KeyFrameCollection.cs
- SettingsContext.cs
- CacheDict.cs
- Timer.cs
- Pair.cs
- TableDetailsRow.cs
- TimelineCollection.cs
- UpdateRecord.cs
- EnumValidator.cs
- GradientStop.cs
- CompatibleIComparer.cs
- SimpleHandlerFactory.cs
- MembershipPasswordException.cs
- WindowsSidIdentity.cs
- ListViewTableRow.cs
- FindCriteriaElement.cs
- ServiceAppDomainAssociationProvider.cs
- FileDialog_Vista_Interop.cs
- ControlUtil.cs
- BitmapEffect.cs
- StringOutput.cs
- SecurityHelper.cs
- ProxyFragment.cs
- NativeMethods.cs
- Array.cs
- SpecularMaterial.cs
- Identity.cs
- DrawingCollection.cs
- SocketException.cs
- GridViewUpdatedEventArgs.cs
- InterleavedZipPartStream.cs
- XhtmlMobileTextWriter.cs
- TemplateBindingExpressionConverter.cs
- OAVariantLib.cs
- SimpleExpression.cs
- AssemblyHelper.cs
- ToolStripDropDown.cs
- PropertyCondition.cs
- CombinedGeometry.cs
- NativeWindow.cs
- DataPagerFieldCommandEventArgs.cs
- ZoneLinkButton.cs
- WindowsNonControl.cs
- WebConfigurationFileMap.cs
- ApplicationInfo.cs
- FixedBufferAttribute.cs
- NativeCppClassAttribute.cs
- WorkflowService.cs
- Directory.cs
- SvcMapFileLoader.cs
- XmlNode.cs
- ComponentEditorPage.cs
- XmlSortKeyAccumulator.cs
- Helpers.cs
- CodeMemberEvent.cs
- XmlDeclaration.cs
- DropAnimation.xaml.cs
- __TransparentProxy.cs
- TileBrush.cs
- DataSourceSelectArguments.cs
- Odbc32.cs
- DropTarget.cs
- WebPartTransformerAttribute.cs
- StorageComplexTypeMapping.cs
- SQLInt32Storage.cs
- SecureStringHasher.cs
- CodeTypeMember.cs
- WindowsSpinner.cs
- RestHandler.cs
- List.cs
- MulticastDelegate.cs
- Parameter.cs
- Viewport3DAutomationPeer.cs
- ItemsControl.cs
- MachineKey.cs
- IResourceProvider.cs
- HashAlgorithm.cs
- DataPointer.cs
- SemanticBasicElement.cs
- VerticalAlignConverter.cs
- TableLayoutPanelCodeDomSerializer.cs
- ScaleTransform3D.cs
- DataGridViewSortCompareEventArgs.cs
- StoragePropertyMapping.cs