Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / infocard / Client / System / IdentityModel / Selectors / InfoCardRSAPKCS1KeyExchangeDeformatter.cs / 1305376 / InfoCardRSAPKCS1KeyExchangeDeformatter.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.IdentityModel.Selectors { using System; using System.Security.Cryptography; internal class InfoCardRSAPKCS1KeyExchangeDeformatter : RSAPKCS1KeyExchangeDeformatter { RSA m_rsaKey; // Constructors public InfoCardRSAPKCS1KeyExchangeDeformatter() {} public InfoCardRSAPKCS1KeyExchangeDeformatter( AsymmetricAlgorithm key ) : base( key ) { m_rsaKey = (RSA) key; } // // public methods // public override byte[] DecryptKeyExchange(byte[] rgbIn) { if ( null != m_rsaKey && m_rsaKey is InfoCardRSACryptoProvider) { return ((InfoCardRSACryptoProvider) m_rsaKey).Decrypt(rgbIn, false); } else { return base.DecryptKeyExchange( rgbIn ); } } 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 InfoCardRSAPKCS1KeyExchangeDeformatter : RSAPKCS1KeyExchangeDeformatter { RSA m_rsaKey; // Constructors public InfoCardRSAPKCS1KeyExchangeDeformatter() {} public InfoCardRSAPKCS1KeyExchangeDeformatter( AsymmetricAlgorithm key ) : base( key ) { m_rsaKey = (RSA) key; } // // public methods // public override byte[] DecryptKeyExchange(byte[] rgbIn) { if ( null != m_rsaKey && m_rsaKey is InfoCardRSACryptoProvider) { return ((InfoCardRSACryptoProvider) m_rsaKey).Decrypt(rgbIn, false); } else { return base.DecryptKeyExchange( rgbIn ); } } 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
- SignatureHelper.cs
- TimeSpanValidator.cs
- ScalarType.cs
- HiddenField.cs
- Keyboard.cs
- Rule.cs
- DataGridViewButtonColumn.cs
- StructuralObject.cs
- TextServicesPropertyRanges.cs
- IODescriptionAttribute.cs
- BreakRecordTable.cs
- ControlCollection.cs
- _LocalDataStore.cs
- BeginStoryboard.cs
- datacache.cs
- ErrorStyle.cs
- BackgroundFormatInfo.cs
- HMACRIPEMD160.cs
- DiscoveryClientProtocol.cs
- FixedFlowMap.cs
- DocumentGrid.cs
- Span.cs
- Soap12FormatExtensions.cs
- XmlSchemaImport.cs
- DoubleKeyFrameCollection.cs
- StringArrayConverter.cs
- GacUtil.cs
- Message.cs
- IndependentlyAnimatedPropertyMetadata.cs
- XmlHierarchicalDataSourceView.cs
- ImpersonateTokenRef.cs
- DataGridTable.cs
- CodeExpressionCollection.cs
- PathFigure.cs
- VirtualDirectoryMappingCollection.cs
- SqlLiftIndependentRowExpressions.cs
- ExpandCollapsePattern.cs
- BackStopAuthenticationModule.cs
- WebPartDisplayModeCancelEventArgs.cs
- PackagingUtilities.cs
- UnsafeNativeMethods.cs
- KerberosRequestorSecurityToken.cs
- MetadataUtilsSmi.cs
- SqlParameter.cs
- HttpListenerRequest.cs
- RemoteWebConfigurationHost.cs
- SpeechSeg.cs
- ProfileService.cs
- MouseWheelEventArgs.cs
- RectangleConverter.cs
- DbDataReader.cs
- PageStatePersister.cs
- SqlCommand.cs
- ValueConversionAttribute.cs
- InternalsVisibleToAttribute.cs
- SQLDateTime.cs
- Stylus.cs
- UnsafeNativeMethodsTablet.cs
- CommandBindingCollection.cs
- ColorContextHelper.cs
- FixedDocumentSequencePaginator.cs
- HierarchicalDataSourceConverter.cs
- SpellerStatusTable.cs
- WebSysDefaultValueAttribute.cs
- XPathDocumentNavigator.cs
- TextServicesProperty.cs
- RegexTree.cs
- DataServiceKeyAttribute.cs
- TraceHwndHost.cs
- BitmapMetadata.cs
- Switch.cs
- AggregateException.cs
- PrivateFontCollection.cs
- ListBoxItem.cs
- UntrustedRecipientException.cs
- BuildProviderAppliesToAttribute.cs
- CreateUserWizard.cs
- X509PeerCertificateAuthentication.cs
- ProtocolsConfiguration.cs
- CreatingCookieEventArgs.cs
- Window.cs
- ConfigurationSectionGroupCollection.cs
- OdbcUtils.cs
- SafeNativeMethods.cs
- VisualStyleRenderer.cs
- SinglePhaseEnlistment.cs
- MetadataCache.cs
- SqlWebEventProvider.cs
- HwndAppCommandInputProvider.cs
- DesignerContextDescriptor.cs
- HTMLTextWriter.cs
- XmlElement.cs
- DataException.cs
- ChangeNode.cs
- StrongNameKeyPair.cs
- EntityDataSourceStatementEditor.cs
- WebServicesSection.cs
- LongAverageAggregationOperator.cs
- DataListAutoFormat.cs
- InlineObject.cs