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
- Viewport3DVisual.cs
- DateTimeConverter2.cs
- PlanCompiler.cs
- OciEnlistContext.cs
- PriorityItem.cs
- NavigatorOutput.cs
- NativeMethods.cs
- ErrorRuntimeConfig.cs
- Timer.cs
- DrawListViewItemEventArgs.cs
- StreamResourceInfo.cs
- UnicodeEncoding.cs
- ClonableStack.cs
- XmlAnyElementAttribute.cs
- XamlToRtfParser.cs
- SqlConnection.cs
- HashAlgorithm.cs
- WebPartZone.cs
- URLIdentityPermission.cs
- AssemblyNameProxy.cs
- RemotingException.cs
- ComponentCollection.cs
- NGCSerializer.cs
- ListBox.cs
- UnsafeNativeMethodsTablet.cs
- XmlTextReader.cs
- MediaPlayerState.cs
- VisualBrush.cs
- DeploymentExceptionMapper.cs
- CodeMethodMap.cs
- AdapterDictionary.cs
- TextDpi.cs
- ADMembershipProvider.cs
- ContextInformation.cs
- SoapElementAttribute.cs
- TypeReference.cs
- FieldToken.cs
- OleServicesContext.cs
- UIElement3D.cs
- StructuredTypeEmitter.cs
- FormViewModeEventArgs.cs
- ThumbButtonInfo.cs
- NameHandler.cs
- ResourceAssociationTypeEnd.cs
- DnsEndPoint.cs
- CustomValidator.cs
- VisualStyleElement.cs
- ServiceSecurityContext.cs
- ResourceReferenceExpression.cs
- MtomMessageEncoder.cs
- CompatibleIComparer.cs
- WindowsListBox.cs
- coordinator.cs
- WebControl.cs
- DbProviderConfigurationHandler.cs
- StyleSheetComponentEditor.cs
- SharedPerformanceCounter.cs
- ClientOptions.cs
- DesignerOptions.cs
- Operand.cs
- CodePageUtils.cs
- ChtmlTextWriter.cs
- LineServices.cs
- ChangePassword.cs
- MetaForeignKeyColumn.cs
- x509utils.cs
- CharStorage.cs
- ReferenceAssemblyAttribute.cs
- RotateTransform3D.cs
- ObjectCloneHelper.cs
- FrameSecurityDescriptor.cs
- AdRotator.cs
- COAUTHINFO.cs
- _LoggingObject.cs
- CallTemplateAction.cs
- HostingEnvironment.cs
- FamilyMapCollection.cs
- ServiceDiscoveryBehavior.cs
- AnalyzedTree.cs
- Roles.cs
- QueryAccessibilityHelpEvent.cs
- WebBaseEventKeyComparer.cs
- ObjectList.cs
- ClassHandlersStore.cs
- PassportIdentity.cs
- CreateUserWizardAutoFormat.cs
- MultiPartWriter.cs
- MediaSystem.cs
- TransactionTable.cs
- SQLRoleProvider.cs
- XmlSchemaImport.cs
- ColorConverter.cs
- CollaborationHelperFunctions.cs
- WindowsAuthenticationEventArgs.cs
- CreateSequence.cs
- ImageIndexEditor.cs
- Light.cs
- Win32Exception.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- NetStream.cs