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
- ReadOnlyDictionary.cs
- ProcessModelSection.cs
- RecordManager.cs
- PointHitTestParameters.cs
- CodeArrayCreateExpression.cs
- TypeCollectionPropertyEditor.cs
- Knowncolors.cs
- MediaEntryAttribute.cs
- WorkflowServiceHost.cs
- COM2ComponentEditor.cs
- WebBrowserUriTypeConverter.cs
- UInt16Converter.cs
- ScrollEventArgs.cs
- Attributes.cs
- TextAutomationPeer.cs
- PerformanceCountersElement.cs
- ManagedFilter.cs
- VirtualDirectoryMapping.cs
- FaultContext.cs
- PackageRelationshipCollection.cs
- SizeConverter.cs
- SizeAnimationBase.cs
- ImageSource.cs
- MenuItem.cs
- RegexCompilationInfo.cs
- XmlDocumentType.cs
- ColumnHeader.cs
- Brush.cs
- EdmFunction.cs
- DBSchemaTable.cs
- Dynamic.cs
- HighlightVisual.cs
- Utils.cs
- InstanceKeyCompleteException.cs
- EffectiveValueEntry.cs
- ContextMenuStripActionList.cs
- GcSettings.cs
- TaskHelper.cs
- CommonXSendMessage.cs
- CodePageUtils.cs
- ThemeDictionaryExtension.cs
- TableDesigner.cs
- UpdatePanelTriggerCollection.cs
- TimeSpanParse.cs
- OuterGlowBitmapEffect.cs
- MimeFormReflector.cs
- Emitter.cs
- HttpFileCollectionWrapper.cs
- BidPrivateBase.cs
- MatrixStack.cs
- PreviewControlDesigner.cs
- HostingEnvironment.cs
- SuppressMessageAttribute.cs
- EventMappingSettingsCollection.cs
- hresults.cs
- ListItemCollection.cs
- PasswordRecoveryDesigner.cs
- GridViewPageEventArgs.cs
- InputReferenceExpression.cs
- CodePageUtils.cs
- StopStoryboard.cs
- XmlUrlEditor.cs
- DbDataReader.cs
- XmlLinkedNode.cs
- AxisAngleRotation3D.cs
- BinHexEncoder.cs
- _ScatterGatherBuffers.cs
- HtmlAnchor.cs
- MouseEvent.cs
- UserPreferenceChangedEventArgs.cs
- TextBoxRenderer.cs
- ZipIOCentralDirectoryBlock.cs
- NativeMethods.cs
- Persist.cs
- ConcurrentQueue.cs
- DataGridPagerStyle.cs
- HttpRuntime.cs
- cookieexception.cs
- ActiveXContainer.cs
- StickyNoteHelper.cs
- InsufficientMemoryException.cs
- StringExpressionSet.cs
- Vertex.cs
- PrintPreviewControl.cs
- GuidelineCollection.cs
- RoleManagerSection.cs
- BeginEvent.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- ReliabilityContractAttribute.cs
- DataFieldCollectionEditor.cs
- CanonicalizationDriver.cs
- HtmlContainerControl.cs
- Scripts.cs
- UserCancellationException.cs
- Memoizer.cs
- AuthenticationServiceManager.cs
- ScriptModule.cs
- MimeTypeAttribute.cs
- SystemBrushes.cs
- WaveHeader.cs