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
- ChannelPoolSettings.cs
- PropertyPath.cs
- ValidationSummary.cs
- EncoderParameters.cs
- ThrowHelper.cs
- CapabilitiesAssignment.cs
- HyperLinkDataBindingHandler.cs
- oledbmetadatacollectionnames.cs
- ThreadInterruptedException.cs
- XmlChildNodes.cs
- ToolStripComboBox.cs
- XPathDocument.cs
- SmtpAuthenticationManager.cs
- MethodExpr.cs
- XPathNodePointer.cs
- UserNameSecurityTokenProvider.cs
- SQLMoney.cs
- InkPresenter.cs
- WebPartDescriptionCollection.cs
- PreloadHost.cs
- BrushMappingModeValidation.cs
- BufferModeSettings.cs
- OwnerDrawPropertyBag.cs
- LocatorBase.cs
- MD5HashHelper.cs
- SslStream.cs
- PenThreadPool.cs
- ProcessInputEventArgs.cs
- TextTrailingCharacterEllipsis.cs
- FileSystemInfo.cs
- ErrorTableItemStyle.cs
- ContextStaticAttribute.cs
- JournalEntry.cs
- XPathBinder.cs
- ThemeableAttribute.cs
- InvalidProgramException.cs
- MobileCapabilities.cs
- MediaTimeline.cs
- SoapException.cs
- SoapTypeAttribute.cs
- TouchDevice.cs
- newinstructionaction.cs
- StyleXamlTreeBuilder.cs
- TrackingConditionCollection.cs
- FilterQueryOptionExpression.cs
- Page.cs
- EntityContainer.cs
- InternalBase.cs
- PerformanceCounterManager.cs
- FixedLineResult.cs
- ASCIIEncoding.cs
- SignatureSummaryDialog.cs
- RandomNumberGenerator.cs
- DbProviderManifest.cs
- ImpersonationOption.cs
- CodeConstructor.cs
- DebugView.cs
- TextEncodedRawTextWriter.cs
- TransportOutputChannel.cs
- NamespaceCollection.cs
- SqlTriggerContext.cs
- BridgeDataRecord.cs
- AuthenticationException.cs
- BackgroundWorker.cs
- TextRangeEdit.cs
- ControlPersister.cs
- Directory.cs
- DataGridRow.cs
- EntityRecordInfo.cs
- WindowsAuthenticationEventArgs.cs
- SystemIPGlobalProperties.cs
- Buffer.cs
- GZipStream.cs
- WsatServiceAddress.cs
- SerialErrors.cs
- XmlSequenceWriter.cs
- DiscoveryRequestHandler.cs
- StaticTextPointer.cs
- UserControl.cs
- XmlSchemaAttributeGroup.cs
- HttpCacheVary.cs
- ResourceReader.cs
- CodeAccessSecurityEngine.cs
- HttpDictionary.cs
- StartFileNameEditor.cs
- RtfNavigator.cs
- SafeSecurityHelper.cs
- DbXmlEnabledProviderManifest.cs
- BooleanFunctions.cs
- TableLayoutPanelBehavior.cs
- SystemIPGlobalProperties.cs
- rsa.cs
- WebResourceAttribute.cs
- HeaderPanel.cs
- OSFeature.cs
- InputBindingCollection.cs
- XmlQualifiedName.cs
- TypeElement.cs
- ProcessModelInfo.cs
- DataContract.cs