Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / infocard / Client / System / IdentityModel / Selectors / InfoCardRSAPKCS1KeyExchangeDeformatter.cs / 1305376 / InfoCardRSAPKCS1KeyExchangeDeformatter.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.IdentityModel.Selectors { using System; using System.Security.Cryptography; internal class InfoCardRSAPKCS1KeyExchangeDeformatter : RSAPKCS1KeyExchangeDeformatter { RSA m_rsaKey; // Constructors public InfoCardRSAPKCS1KeyExchangeDeformatter() {} public InfoCardRSAPKCS1KeyExchangeDeformatter( AsymmetricAlgorithm key ) : base( key ) { m_rsaKey = (RSA) key; } // // public methods // public override byte[] DecryptKeyExchange(byte[] rgbIn) { if ( null != m_rsaKey && m_rsaKey is InfoCardRSACryptoProvider) { return ((InfoCardRSACryptoProvider) m_rsaKey).Decrypt(rgbIn, false); } else { return base.DecryptKeyExchange( rgbIn ); } } public override void SetKey(AsymmetricAlgorithm key) { base.SetKey( key ); m_rsaKey = (RSA) key; } } } // 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 InfoCardRSAPKCS1KeyExchangeDeformatter : RSAPKCS1KeyExchangeDeformatter { RSA m_rsaKey; // Constructors public InfoCardRSAPKCS1KeyExchangeDeformatter() {} public InfoCardRSAPKCS1KeyExchangeDeformatter( AsymmetricAlgorithm key ) : base( key ) { m_rsaKey = (RSA) key; } // // public methods // public override byte[] DecryptKeyExchange(byte[] rgbIn) { if ( null != m_rsaKey && m_rsaKey is InfoCardRSACryptoProvider) { return ((InfoCardRSACryptoProvider) m_rsaKey).Decrypt(rgbIn, false); } else { return base.DecryptKeyExchange( rgbIn ); } } public override void SetKey(AsymmetricAlgorithm key) { base.SetKey( key ); m_rsaKey = (RSA) key; } } } // 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
- UIElement.cs
- UniformGrid.cs
- Monitor.cs
- ToolStripDesignerAvailabilityAttribute.cs
- NonParentingControl.cs
- QuerySelectOp.cs
- MessageFilter.cs
- StringToken.cs
- BinaryObjectReader.cs
- DataTableMappingCollection.cs
- AmbiguousMatchException.cs
- MatchingStyle.cs
- DSACryptoServiceProvider.cs
- DataGridRowAutomationPeer.cs
- FigureHelper.cs
- ProcessThread.cs
- FileSystemWatcher.cs
- Operand.cs
- FontWeight.cs
- QueryResult.cs
- LinearGradientBrush.cs
- CodeGeneratorOptions.cs
- SqlDataSource.cs
- WithStatement.cs
- XmlSchemaComplexContent.cs
- InheritablePropertyChangeInfo.cs
- XmlAttributes.cs
- RowUpdatedEventArgs.cs
- wmiprovider.cs
- WindowsUpDown.cs
- ClientFormsIdentity.cs
- Attribute.cs
- ToolboxItem.cs
- RowVisual.cs
- DetailsViewUpdateEventArgs.cs
- TempFiles.cs
- XPathScanner.cs
- TableAutomationPeer.cs
- DependencyPropertyKey.cs
- HierarchicalDataBoundControlAdapter.cs
- Matrix3D.cs
- TextContainerChangeEventArgs.cs
- ConstraintStruct.cs
- DPCustomTypeDescriptor.cs
- PtsHelper.cs
- TypeForwardedFromAttribute.cs
- LinqDataSourceDisposeEventArgs.cs
- StrokeNodeData.cs
- ADConnectionHelper.cs
- MobileListItem.cs
- DataSourceHelper.cs
- precedingquery.cs
- QuadTree.cs
- RangeValuePattern.cs
- SimpleTableProvider.cs
- NamespaceInfo.cs
- followingquery.cs
- SerializableAttribute.cs
- CalculatedColumn.cs
- CoTaskMemSafeHandle.cs
- FreeFormPanel.cs
- FrameDimension.cs
- Baml2006KnownTypes.cs
- CollectionViewGroup.cs
- MaterializeFromAtom.cs
- SecurityToken.cs
- HttpPostedFileBase.cs
- ExtendedPropertyCollection.cs
- GridViewCommandEventArgs.cs
- PathFigureCollection.cs
- AssemblyInfo.cs
- FloatUtil.cs
- DocumentViewer.cs
- DataRelation.cs
- ProcessHostMapPath.cs
- DataServiceProviderMethods.cs
- DBConnectionString.cs
- RuleConditionDialog.Designer.cs
- SqlConnectionHelper.cs
- ItemAutomationPeer.cs
- _Events.cs
- Vector3DValueSerializer.cs
- ComplexObject.cs
- ButtonFieldBase.cs
- WorkflowFormatterBehavior.cs
- Graphics.cs
- OuterProxyWrapper.cs
- SettingsSavedEventArgs.cs
- HwndTarget.cs
- MenuItemAutomationPeer.cs
- XmlArrayAttribute.cs
- RemoteHelper.cs
- WebMessageFormatHelper.cs
- PartitionedStream.cs
- XmlAtomicValue.cs
- TrackingStringDictionary.cs
- Point3DCollection.cs
- ProfileProvider.cs
- EntitySqlQueryState.cs
- CommonDialog.cs