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
- Vector3DAnimationUsingKeyFrames.cs
- MSAANativeProvider.cs
- ColorAnimation.cs
- filewebrequest.cs
- WebPart.cs
- StringFunctions.cs
- BaseCAMarshaler.cs
- UpdateCommand.cs
- TypeConverterValueSerializer.cs
- GridViewDeletedEventArgs.cs
- StaticExtension.cs
- ProgressBarHighlightConverter.cs
- XmlParserContext.cs
- TransactionTable.cs
- DateTimeOffsetAdapter.cs
- XmlILStorageConverter.cs
- FileIOPermission.cs
- RuleElement.cs
- PropertyDescriptorComparer.cs
- EventMappingSettingsCollection.cs
- SimpleColumnProvider.cs
- WindowsListViewGroupHelper.cs
- AssemblyResolver.cs
- MonitoringDescriptionAttribute.cs
- Point3DAnimationUsingKeyFrames.cs
- OdbcPermission.cs
- remotingproxy.cs
- WebServiceData.cs
- ZipFileInfo.cs
- AnimationTimeline.cs
- TimeSpanOrInfiniteConverter.cs
- DLinqDataModelProvider.cs
- GetCardDetailsRequest.cs
- FocusManager.cs
- DocumentXPathNavigator.cs
- WriteFileContext.cs
- StrokeCollection.cs
- WizardForm.cs
- odbcmetadatacolumnnames.cs
- EntityViewGenerationConstants.cs
- PathSegment.cs
- CounterCreationData.cs
- ResourceAssociationSet.cs
- TreeViewCancelEvent.cs
- NullRuntimeConfig.cs
- DBCSCodePageEncoding.cs
- WsdlInspector.cs
- DataIdProcessor.cs
- ThemeDirectoryCompiler.cs
- BrushConverter.cs
- UriSection.cs
- MetadataSerializer.cs
- RenderData.cs
- Compiler.cs
- PrinterSettings.cs
- HostingPreferredMapPath.cs
- PlatformNotSupportedException.cs
- VisualBasicDesignerHelper.cs
- documentsequencetextcontainer.cs
- ComponentChangedEvent.cs
- WebPartManagerInternals.cs
- DiscreteKeyFrames.cs
- UnsignedPublishLicense.cs
- StyleSheet.cs
- LinkArea.cs
- SqlWebEventProvider.cs
- TextElementCollectionHelper.cs
- ExceptionHandlersDesigner.cs
- ConnectionStringsExpressionBuilder.cs
- FunctionOverloadResolver.cs
- FormatException.cs
- PathSegment.cs
- OptimalBreakSession.cs
- ContractCodeDomInfo.cs
- FontFaceLayoutInfo.cs
- WebBrowserSiteBase.cs
- HitTestWithGeometryDrawingContextWalker.cs
- SecurityAttributeGenerationHelper.cs
- CompilerScopeManager.cs
- odbcmetadatafactory.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- SendReply.cs
- HwndSourceKeyboardInputSite.cs
- VisualStyleTypesAndProperties.cs
- BinaryParser.cs
- SoapTypeAttribute.cs
- PerformanceCountersElement.cs
- CodeNamespace.cs
- SelectionProviderWrapper.cs
- CombinedGeometry.cs
- WhitespaceSignificantCollectionAttribute.cs
- SecurityElement.cs
- AbandonedMutexException.cs
- DisplayNameAttribute.cs
- XamlFilter.cs
- AttachmentService.cs
- COM2TypeInfoProcessor.cs
- TraceContextEventArgs.cs
- TableChangeProcessor.cs
- RegexCapture.cs