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
- WebPartsPersonalization.cs
- MetabaseSettings.cs
- BroadcastEventHelper.cs
- GridViewEditEventArgs.cs
- DataComponentGenerator.cs
- EntityRecordInfo.cs
- ChannelDispatcher.cs
- WebEncodingValidator.cs
- SplitterPanel.cs
- SqlConnectionManager.cs
- OleDbRowUpdatedEvent.cs
- LookupNode.cs
- CryptoHelper.cs
- ClientBuildManagerTypeDescriptionProviderBridge.cs
- SqlUDTStorage.cs
- WebUtil.cs
- TemplateComponentConnector.cs
- TypeDelegator.cs
- SaveFileDialog.cs
- ModelServiceImpl.cs
- XmlDataProvider.cs
- CategoryAttribute.cs
- Gdiplus.cs
- XmlReaderDelegator.cs
- UnsettableComboBox.cs
- InitializationEventAttribute.cs
- MarkupProperty.cs
- ListViewCommandEventArgs.cs
- WebPartMenuStyle.cs
- Attributes.cs
- FontStyles.cs
- NestedContainer.cs
- Thickness.cs
- WhitespaceSignificantCollectionAttribute.cs
- ProcessHostMapPath.cs
- MessageEnumerator.cs
- SqlNamer.cs
- BindToObject.cs
- ToolStripKeyboardHandlingService.cs
- SafeSecurityHandles.cs
- PerformanceCounterCategory.cs
- RegexInterpreter.cs
- XPathNavigator.cs
- RouteItem.cs
- TextAdaptor.cs
- KeyedHashAlgorithm.cs
- IncrementalCompileAnalyzer.cs
- CharEntityEncoderFallback.cs
- WeakReadOnlyCollection.cs
- DecoderReplacementFallback.cs
- AudioException.cs
- XmlConvert.cs
- SafeRightsManagementHandle.cs
- LocatorPart.cs
- arc.cs
- ProcessModelInfo.cs
- ClientConvert.cs
- ResourcesBuildProvider.cs
- WebBrowserNavigatingEventHandler.cs
- DurableInstanceContextProvider.cs
- MobileDeviceCapabilitiesSectionHandler.cs
- BitVec.cs
- ObjectReferenceStack.cs
- Utils.cs
- ISAPIRuntime.cs
- StoreItemCollection.cs
- IdentityManager.cs
- dataprotectionpermission.cs
- UnsafeNativeMethods.cs
- DrawingVisual.cs
- MessageBox.cs
- SqlBulkCopy.cs
- Nullable.cs
- ItemCollection.cs
- SuppressMergeCheckAttribute.cs
- CompilerInfo.cs
- DecimalMinMaxAggregationOperator.cs
- XmlWrappingReader.cs
- Grid.cs
- DesignTimeTemplateParser.cs
- NetworkAddressChange.cs
- VirtualizingStackPanel.cs
- TextServicesHost.cs
- LayoutEvent.cs
- ADMembershipProvider.cs
- RadioButton.cs
- ViewRendering.cs
- DBConcurrencyException.cs
- CategoryAttribute.cs
- EditorPart.cs
- StreamSecurityUpgradeInitiatorAsyncResult.cs
- ContextMarshalException.cs
- MissingManifestResourceException.cs
- SqlRowUpdatedEvent.cs
- ButtonFieldBase.cs
- WebPartDisplayModeCollection.cs
- CodeTypeConstructor.cs
- BamlMapTable.cs
- TextTreeInsertUndoUnit.cs
- AnimatedTypeHelpers.cs