Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / infocard / Client / System / IdentityModel / Selectors / InfoCardRSAOAEPKeyExchangeFormatter.cs / 1305376 / InfoCardRSAOAEPKeyExchangeFormatter.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.IdentityModel.Selectors { using System; using System.Security.Cryptography; internal class InfoCardRSAOAEPKeyExchangeFormatter : RSAOAEPKeyExchangeFormatter { private RSA m_rsaKey; // // public constructors // public InfoCardRSAOAEPKeyExchangeFormatter() : base() {} public InfoCardRSAOAEPKeyExchangeFormatter( 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, true); } else { return base.CreateKeyExchange( rgbData ); } } } } // 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 InfoCardRSAOAEPKeyExchangeFormatter : RSAOAEPKeyExchangeFormatter { private RSA m_rsaKey; // // public constructors // public InfoCardRSAOAEPKeyExchangeFormatter() : base() {} public InfoCardRSAOAEPKeyExchangeFormatter( 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, true); } 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
- OleDbConnection.cs
- TextParagraphCache.cs
- HttpBindingExtension.cs
- DataObjectPastingEventArgs.cs
- OneToOneMappingSerializer.cs
- HttpClientProtocol.cs
- ISCIIEncoding.cs
- DataGridViewRowsAddedEventArgs.cs
- PageRanges.cs
- TileBrush.cs
- OpenTypeLayout.cs
- PluralizationService.cs
- Block.cs
- Bookmark.cs
- SystemDropShadowChrome.cs
- PolyLineSegment.cs
- DesignerAttribute.cs
- ObjectStateFormatter.cs
- Transform.cs
- WmlTextViewAdapter.cs
- Pair.cs
- EventWaitHandleSecurity.cs
- WindowsGraphics2.cs
- SortFieldComparer.cs
- DataMemberFieldConverter.cs
- PreviewPrintController.cs
- CodeCommentStatement.cs
- codemethodreferenceexpression.cs
- EditorAttribute.cs
- DataGridBoundColumn.cs
- DateTimeUtil.cs
- TreeBuilder.cs
- BaseTreeIterator.cs
- FileRecordSequenceHelper.cs
- KeyboardInputProviderAcquireFocusEventArgs.cs
- ForceCopyBuildProvider.cs
- WindowsFormsHelpers.cs
- SystemInfo.cs
- Timer.cs
- ZoneMembershipCondition.cs
- RotateTransform3D.cs
- DataGridDetailsPresenter.cs
- DeploymentSection.cs
- unsafenativemethodstextservices.cs
- ValidationRuleCollection.cs
- CustomAttributeBuilder.cs
- WebSysDefaultValueAttribute.cs
- HwndSourceParameters.cs
- UpdateManifestForBrowserApplication.cs
- SqlCacheDependencyDatabase.cs
- ValidationErrorEventArgs.cs
- Operators.cs
- NullableConverter.cs
- OleDbFactory.cs
- SizeLimitedCache.cs
- ObjectManager.cs
- DependencyPropertyHelper.cs
- MetafileEditor.cs
- MobileControlPersister.cs
- datacache.cs
- LogicalExpressionEditor.cs
- MimeReturn.cs
- SmtpNegotiateAuthenticationModule.cs
- StructuralCache.cs
- TargetControlTypeCache.cs
- XmlWellformedWriter.cs
- FileSystemInfo.cs
- RootBrowserWindowProxy.cs
- ValidationEventArgs.cs
- ReferenceService.cs
- SqlGenerator.cs
- BindingCompleteEventArgs.cs
- FontStretchConverter.cs
- OutputScope.cs
- TreeNodeBinding.cs
- EventProvider.cs
- ListView.cs
- HitTestResult.cs
- XmlObjectSerializerWriteContextComplexJson.cs
- Ray3DHitTestResult.cs
- CodeExpressionStatement.cs
- TypeEnumerableViewSchema.cs
- TemplateDefinition.cs
- CacheChildrenQuery.cs
- FormsAuthenticationTicket.cs
- StringUtil.cs
- DataGridViewAdvancedBorderStyle.cs
- QueryableDataSourceHelper.cs
- DetailsViewRow.cs
- OleDbParameter.cs
- ListChangedEventArgs.cs
- XsdCachingReader.cs
- _UncName.cs
- MemberAssignment.cs
- WebPartCollection.cs
- SuppressIldasmAttribute.cs
- StylusEventArgs.cs
- BitmapCodecInfo.cs
- SQLResource.cs
- FormatException.cs