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
- SspiHelper.cs
- GradientBrush.cs
- DesignerView.xaml.cs
- DocumentViewerBaseAutomationPeer.cs
- XmlResolver.cs
- DropTarget.cs
- ReversePositionQuery.cs
- WebPartCloseVerb.cs
- CompletionCallbackWrapper.cs
- DateTimeOffsetStorage.cs
- SimplePropertyEntry.cs
- Compilation.cs
- CapabilitiesPattern.cs
- InheritanceAttribute.cs
- ConcurrentQueue.cs
- ArgumentOutOfRangeException.cs
- TransformProviderWrapper.cs
- MenuStrip.cs
- PerfProviderCollection.cs
- COM2ExtendedBrowsingHandler.cs
- ParsedRoute.cs
- GroupAggregateExpr.cs
- HostDesigntimeLicenseContext.cs
- DBDataPermission.cs
- CodeMemberField.cs
- WebPartPersonalization.cs
- AnnouncementInnerClientCD1.cs
- M3DUtil.cs
- DesignTable.cs
- ResourcesBuildProvider.cs
- ItemChangedEventArgs.cs
- SqlTriggerAttribute.cs
- LinqMaximalSubtreeNominator.cs
- Stylesheet.cs
- SerializerProvider.cs
- AnnotationResource.cs
- SerialPinChanges.cs
- NativeMethods.cs
- LocalizeDesigner.cs
- FrameworkContextData.cs
- PageParserFilter.cs
- BamlResourceDeserializer.cs
- DateTime.cs
- MenuItemBinding.cs
- GcHandle.cs
- ScriptingProfileServiceSection.cs
- WebPartConnectionsConfigureVerb.cs
- LinearKeyFrames.cs
- ToolbarAUtomationPeer.cs
- LoadRetryAsyncResult.cs
- StructuralType.cs
- Mapping.cs
- UrlPath.cs
- TabletDevice.cs
- ContainerParagraph.cs
- NestedContainer.cs
- URLMembershipCondition.cs
- TransformationRules.cs
- DelayedRegex.cs
- InteropAutomationProvider.cs
- SchemaManager.cs
- UnaryOperationBinder.cs
- WindowsFormsHelpers.cs
- SafeNativeMethodsOther.cs
- StickyNoteAnnotations.cs
- LockedBorderGlyph.cs
- AncillaryOps.cs
- TableLayoutStyleCollection.cs
- Image.cs
- CreateUserWizardStep.cs
- TypeSystem.cs
- ResourceExpressionBuilder.cs
- ScriptManagerProxy.cs
- MetaData.cs
- Cursors.cs
- TrustLevel.cs
- DataObjectFieldAttribute.cs
- SqlEnums.cs
- QilInvoke.cs
- OpenFileDialog.cs
- WebControlAdapter.cs
- VScrollBar.cs
- Run.cs
- WebHttpEndpointElement.cs
- SafeNativeMethods.cs
- EntitySqlQueryCacheEntry.cs
- AudioBase.cs
- TextServicesManager.cs
- _NtlmClient.cs
- pingexception.cs
- XmlDocumentType.cs
- PenCursorManager.cs
- IsolationInterop.cs
- Encoder.cs
- JsonWriter.cs
- CodeValidator.cs
- GroupBox.cs
- RequestSecurityToken.cs
- DesignerActionKeyboardBehavior.cs
- FormatterServices.cs