Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / infocard / Client / System / IdentityModel / Selectors / InfoCardRSAOAEPKeyExchangeDeformatter.cs / 1305376 / InfoCardRSAOAEPKeyExchangeDeformatter.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.IdentityModel.Selectors { using System; using System.Security.Cryptography; internal class InfoCardRSAOAEPKeyExchangeDeformatter : RSAOAEPKeyExchangeDeformatter { private RSA m_rsaKey; // RSA Key value to do decrypt operation // // public constructors // public InfoCardRSAOAEPKeyExchangeDeformatter() : base() {} public InfoCardRSAOAEPKeyExchangeDeformatter( AsymmetricAlgorithm key ) : base( key ) { m_rsaKey = (RSA) key; } // // public methods // public override byte[] DecryptKeyExchange( byte[] rgbData ) { if ( null != m_rsaKey && m_rsaKey is InfoCardRSACryptoProvider ) { return ((InfoCardRSACryptoProvider) m_rsaKey).Decrypt( rgbData, true ); } else { return base.DecryptKeyExchange( rgbData ); } } 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 InfoCardRSAOAEPKeyExchangeDeformatter : RSAOAEPKeyExchangeDeformatter { private RSA m_rsaKey; // RSA Key value to do decrypt operation // // public constructors // public InfoCardRSAOAEPKeyExchangeDeformatter() : base() {} public InfoCardRSAOAEPKeyExchangeDeformatter( AsymmetricAlgorithm key ) : base( key ) { m_rsaKey = (RSA) key; } // // public methods // public override byte[] DecryptKeyExchange( byte[] rgbData ) { if ( null != m_rsaKey && m_rsaKey is InfoCardRSACryptoProvider ) { return ((InfoCardRSACryptoProvider) m_rsaKey).Decrypt( rgbData, true ); } else { return base.DecryptKeyExchange( rgbData ); } } 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
- PropertyBuilder.cs
- DeviceSpecificChoice.cs
- UserPrincipalNameElement.cs
- DataGridItemAttachedStorage.cs
- ConfigurationLockCollection.cs
- TagPrefixCollection.cs
- DeflateEmulationStream.cs
- ValidatingReaderNodeData.cs
- QueryAccessibilityHelpEvent.cs
- DataGridPagerStyle.cs
- DelegatingHeader.cs
- FixedHighlight.cs
- MimeReflector.cs
- CatalogZoneBase.cs
- TextComposition.cs
- DialogResultConverter.cs
- ContentWrapperAttribute.cs
- Subtree.cs
- SerialStream.cs
- GenericUriParser.cs
- SizeIndependentAnimationStorage.cs
- WindowsScrollBar.cs
- PixelFormatConverter.cs
- HttpProfileGroupBase.cs
- ChildrenQuery.cs
- Configuration.cs
- BindingList.cs
- Schema.cs
- IteratorDescriptor.cs
- TextSelectionProcessor.cs
- UTF32Encoding.cs
- Resources.Designer.cs
- InkCanvasSelectionAdorner.cs
- FileNotFoundException.cs
- GetWorkflowTree.cs
- TrustLevelCollection.cs
- ValidationError.cs
- PipelineModuleStepContainer.cs
- AddingNewEventArgs.cs
- VisualBrush.cs
- Menu.cs
- ThreadStartException.cs
- PassportPrincipal.cs
- PriorityRange.cs
- RoutedEvent.cs
- BaseDataBoundControlDesigner.cs
- ThemeInfoAttribute.cs
- ClonableStack.cs
- ObjectAnimationBase.cs
- RoleService.cs
- SqlCommandBuilder.cs
- Span.cs
- SqlMethodAttribute.cs
- NavigationCommands.cs
- XmlValidatingReaderImpl.cs
- TokenizerHelper.cs
- UndirectedGraph.cs
- RegularExpressionValidator.cs
- ExecutionPropertyManager.cs
- ClientSponsor.cs
- XmlFormatWriterGenerator.cs
- VirtualDirectoryMapping.cs
- GradientStop.cs
- ResourcePart.cs
- pingexception.cs
- Attachment.cs
- PartialToken.cs
- ButtonBase.cs
- DesignerActionItemCollection.cs
- SQLGuid.cs
- SemanticValue.cs
- ComAdminWrapper.cs
- DataExpression.cs
- EntityDataSource.cs
- HttpModuleCollection.cs
- XmlDataLoader.cs
- ToolStripDropDownButton.cs
- XmlUnspecifiedAttribute.cs
- newinstructionaction.cs
- Storyboard.cs
- DataGridRowHeaderAutomationPeer.cs
- StylusOverProperty.cs
- IssuedSecurityTokenParameters.cs
- DecoderFallback.cs
- StorageAssociationSetMapping.cs
- HttpListenerElement.cs
- RegisteredScript.cs
- autovalidator.cs
- SqlFileStream.cs
- RecordsAffectedEventArgs.cs
- CLRBindingWorker.cs
- TypeConverters.cs
- XmlLanguageConverter.cs
- ConfigXmlReader.cs
- PersistenceTypeAttribute.cs
- PreProcessor.cs
- GraphicsContext.cs
- IncrementalHitTester.cs
- WebPartsPersonalization.cs
- ArrangedElement.cs