Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- IPPacketInformation.cs
- ValidatorCollection.cs
- SqlDataReader.cs
- EncoderParameters.cs
- EntitySqlQueryBuilder.cs
- PageCache.cs
- Environment.cs
- RepeaterDataBoundAdapter.cs
- ResourcesChangeInfo.cs
- mda.cs
- DateTime.cs
- ObjectDataSourceSelectingEventArgs.cs
- GradientStop.cs
- CodeArrayCreateExpression.cs
- ListViewInsertEventArgs.cs
- DateTime.cs
- ParameterRetriever.cs
- NonClientArea.cs
- ExpressionEvaluator.cs
- CompareValidator.cs
- SettingsPropertyWrongTypeException.cs
- PermissionSetTriple.cs
- DiscreteKeyFrames.cs
- DataViewListener.cs
- SQLInt32Storage.cs
- ToolStripPanelSelectionBehavior.cs
- DataRelationCollection.cs
- NullableDecimalSumAggregationOperator.cs
- Mutex.cs
- TrustLevel.cs
- IssuanceLicense.cs
- TokenizerHelper.cs
- StorageFunctionMapping.cs
- SettingsPropertyValueCollection.cs
- Process.cs
- StatusBarPanel.cs
- LayoutUtils.cs
- PersonalizationDictionary.cs
- DocumentOrderComparer.cs
- fixedPageContentExtractor.cs
- EUCJPEncoding.cs
- IsolationInterop.cs
- DataPointer.cs
- HtmlInputButton.cs
- PropertyExpression.cs
- OperationAbortedException.cs
- SelectedDatesCollection.cs
- MenuBindingsEditorForm.cs
- HealthMonitoringSection.cs
- LogEntryDeserializer.cs
- UserPreferenceChangedEventArgs.cs
- UInt64.cs
- AddressAccessDeniedException.cs
- Transform.cs
- SubstitutionDesigner.cs
- ApplicationHost.cs
- CorrelationInitializer.cs
- EdmItemCollection.cs
- _Rfc2616CacheValidators.cs
- DictionaryItemsCollection.cs
- AnimationStorage.cs
- Label.cs
- XamlTemplateSerializer.cs
- FactoryGenerator.cs
- ParameterDataSourceExpression.cs
- DependencyPropertyHelper.cs
- PrintPageEvent.cs
- RSAPKCS1KeyExchangeFormatter.cs
- SqlRowUpdatedEvent.cs
- _SslStream.cs
- DecimalAverageAggregationOperator.cs
- DataGridViewMethods.cs
- LayoutEditorPart.cs
- ConfigXmlWhitespace.cs
- HwndProxyElementProvider.cs
- WindowsFormsHostPropertyMap.cs
- Visual3D.cs
- WorkflowServiceNamespace.cs
- ViewCellSlot.cs
- DataSourceHelper.cs
- DataGridViewDataConnection.cs
- HttpListenerPrefixCollection.cs
- SqlGenericUtil.cs
- PolyLineSegment.cs
- _BufferOffsetSize.cs
- ToolboxItemFilterAttribute.cs
- ImageAutomationPeer.cs
- UserMapPath.cs
- BitmapFrameEncode.cs
- VersionPair.cs
- RegexRunner.cs
- TableRowGroup.cs
- BindingOperations.cs
- RestHandler.cs
- EntityDataSourceEntityTypeFilterItem.cs
- TextSelectionHelper.cs
- ResourceExpressionEditor.cs
- TableChangeProcessor.cs
- SafeFreeMibTable.cs
- TreeSet.cs