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
- RawAppCommandInputReport.cs
- XPathDocumentIterator.cs
- ListBase.cs
- SafeFindHandle.cs
- TextParagraph.cs
- NameValueConfigurationElement.cs
- hwndwrapper.cs
- DateTimePicker.cs
- ThreadExceptionDialog.cs
- templategroup.cs
- XmlSchemaSimpleContentExtension.cs
- QilVisitor.cs
- GACMembershipCondition.cs
- MediaEntryAttribute.cs
- XmlEventCache.cs
- AssertFilter.cs
- HelloMessageCD1.cs
- DataPointer.cs
- HScrollProperties.cs
- ColumnResult.cs
- DispatchWrapper.cs
- ReadOnlyObservableCollection.cs
- ThreadExceptionEvent.cs
- PermissionSet.cs
- ProcessHostMapPath.cs
- TypeCodeDomSerializer.cs
- RectangleHotSpot.cs
- FlowLayout.cs
- embossbitmapeffect.cs
- StaticDataManager.cs
- MsmqInputChannelBase.cs
- GridView.cs
- Group.cs
- ContentPlaceHolder.cs
- HttpVersion.cs
- StylusPointPropertyUnit.cs
- C14NUtil.cs
- Rect3D.cs
- Content.cs
- PropertyCondition.cs
- Events.cs
- DataSetUtil.cs
- CodeLabeledStatement.cs
- HttpHandlerAction.cs
- InternalSafeNativeMethods.cs
- ValidationErrorCollection.cs
- TableLayoutPanelDesigner.cs
- LambdaCompiler.Statements.cs
- VectorConverter.cs
- FunctionNode.cs
- BitmapSourceSafeMILHandle.cs
- ISO2022Encoding.cs
- HuffModule.cs
- SortKey.cs
- DataBinding.cs
- ITreeGenerator.cs
- ComplexPropertyEntry.cs
- SHA256.cs
- NativeMethods.cs
- RtfNavigator.cs
- ExpressionConverter.cs
- DataGridViewCellValidatingEventArgs.cs
- FontSourceCollection.cs
- PartialTrustVisibleAssembliesSection.cs
- CodeTypeReference.cs
- typedescriptorpermissionattribute.cs
- PropertiesTab.cs
- BuildProviderCollection.cs
- DSACryptoServiceProvider.cs
- HttpModuleCollection.cs
- ConstructorNeedsTagAttribute.cs
- AttributeTableBuilder.cs
- SettingsPropertyCollection.cs
- DependencyObjectPropertyDescriptor.cs
- FixedSOMPageConstructor.cs
- FontResourceCache.cs
- CheckBoxBaseAdapter.cs
- SystemIcmpV6Statistics.cs
- HtmlValidationSummaryAdapter.cs
- PackageStore.cs
- DataBinder.cs
- SubpageParagraph.cs
- VisualBrush.cs
- ConnectionStringSettings.cs
- ADConnectionHelper.cs
- CodeFieldReferenceExpression.cs
- Annotation.cs
- PerfCounters.cs
- RijndaelCryptoServiceProvider.cs
- ToolStripGrip.cs
- ListQueryResults.cs
- RsaSecurityToken.cs
- Filter.cs
- FixedDocumentPaginator.cs
- CommandID.cs
- HostedHttpRequestAsyncResult.cs
- FunctionParameter.cs
- XmlConvert.cs
- InitializeCorrelation.cs
- ExtendedPropertyCollection.cs