Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / infocard / Client / System / IdentityModel / Selectors / InfoCardRSAPKCS1SignatureFormatter.cs / 1305376 / InfoCardRSAPKCS1SignatureFormatter.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.IdentityModel.Selectors { using System; using System.Security.Cryptography; internal class InfoCardRSAPKCS1SignatureFormatter : RSAPKCS1SignatureFormatter { private RSA m_rsaKey; private string m_strOID; // // public constructors // public InfoCardRSAPKCS1SignatureFormatter() : base() {} public InfoCardRSAPKCS1SignatureFormatter( 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 void SetHashAlgorithm( string strName ) { base.SetHashAlgorithm( strName ); m_strOID = CryptoConfig.MapNameToOID(strName); } public override byte[] CreateSignature(byte[] rgbHash) { if ( !( null == m_strOID || null == m_rsaKey || null == rgbHash ) && m_rsaKey is InfoCardRSACryptoProvider ) { return ((InfoCardRSACryptoProvider) m_rsaKey).SignHash( rgbHash, m_strOID ); } else { return base.CreateSignature( rgbHash ); } } } } // 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 InfoCardRSAPKCS1SignatureFormatter : RSAPKCS1SignatureFormatter { private RSA m_rsaKey; private string m_strOID; // // public constructors // public InfoCardRSAPKCS1SignatureFormatter() : base() {} public InfoCardRSAPKCS1SignatureFormatter( 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 void SetHashAlgorithm( string strName ) { base.SetHashAlgorithm( strName ); m_strOID = CryptoConfig.MapNameToOID(strName); } public override byte[] CreateSignature(byte[] rgbHash) { if ( !( null == m_strOID || null == m_rsaKey || null == rgbHash ) && m_rsaKey is InfoCardRSACryptoProvider ) { return ((InfoCardRSACryptoProvider) m_rsaKey).SignHash( rgbHash, m_strOID ); } else { return base.CreateSignature( rgbHash ); } } } } // 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
- WindowsClaimSet.cs
- TableCellAutomationPeer.cs
- WmlLiteralTextAdapter.cs
- MbpInfo.cs
- RequestCachePolicy.cs
- ChangeConflicts.cs
- SqlBulkCopy.cs
- MemberInitExpression.cs
- Property.cs
- BinHexEncoder.cs
- bidPrivateBase.cs
- ManipulationDevice.cs
- OracleRowUpdatedEventArgs.cs
- SoapEnumAttribute.cs
- CleanUpVirtualizedItemEventArgs.cs
- WhereQueryOperator.cs
- WizardStepBase.cs
- XamlTypeMapper.cs
- SectionUpdates.cs
- MethodToken.cs
- PanelDesigner.cs
- HostingEnvironmentSection.cs
- NativeCppClassAttribute.cs
- ObjectDataSource.cs
- SrgsElementFactoryCompiler.cs
- RelationalExpressions.cs
- _ChunkParse.cs
- TableLayoutPanelCellPosition.cs
- Clipboard.cs
- Util.cs
- DLinqAssociationProvider.cs
- ListViewSelectEventArgs.cs
- PrivateFontCollection.cs
- RoleGroupCollection.cs
- HtmlInputPassword.cs
- PriorityChain.cs
- ContainerUIElement3D.cs
- XPathNodePointer.cs
- SqlDataRecord.cs
- HttpRawResponse.cs
- CommonDialog.cs
- ADRoleFactoryConfiguration.cs
- ComplexPropertyEntry.cs
- Scheduling.cs
- DecoderNLS.cs
- ButtonRenderer.cs
- ControlParser.cs
- ResourcePermissionBase.cs
- WSHttpBindingCollectionElement.cs
- NameNode.cs
- EntityRecordInfo.cs
- IsolatedStorage.cs
- PointCollection.cs
- AccessDataSource.cs
- MailHeaderInfo.cs
- Crc32.cs
- BamlRecordHelper.cs
- PresentationSource.cs
- FloaterBaseParaClient.cs
- WebPartHelpVerb.cs
- SerializerWriterEventHandlers.cs
- ArglessEventHandlerProxy.cs
- DataException.cs
- SafeProcessHandle.cs
- StylusSystemGestureEventArgs.cs
- Rfc2898DeriveBytes.cs
- OleDbException.cs
- _NTAuthentication.cs
- TabletDevice.cs
- WsdlInspector.cs
- ClockGroup.cs
- ErrorView.xaml.cs
- CacheVirtualItemsEvent.cs
- ReaderWriterLock.cs
- SelectionEditingBehavior.cs
- unsafenativemethodsother.cs
- ResourceBinder.cs
- XmlLinkedNode.cs
- RightsManagementManager.cs
- WebPartAuthorizationEventArgs.cs
- ListBindingConverter.cs
- HttpChannelListener.cs
- StyleReferenceConverter.cs
- FontStyle.cs
- BitmapPalette.cs
- Main.cs
- CapabilitiesRule.cs
- XmlUrlResolver.cs
- OleDbConnection.cs
- TypeConverterHelper.cs
- ManagedFilter.cs
- DetailsViewRowCollection.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- HTTPNotFoundHandler.cs
- DataListItem.cs
- QuerySelectOp.cs
- MonthChangedEventArgs.cs
- ModelTreeEnumerator.cs
- QilInvokeLateBound.cs
- ClipboardData.cs