Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / infocard / Client / System / IdentityModel / Selectors / InfoCardRSAPKCS1SignatureDeformatter.cs / 1305376 / InfoCardRSAPKCS1SignatureDeformatter.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.IdentityModel.Selectors { using System; using System.Security.Cryptography; internal class InfoCardRSAPKCS1SignatureDeformatter : RSAPKCS1SignatureDeformatter { private RSA m_rsaKey; // RSA Key value to do decrypt operation private string m_strOID; // OID value for the HASH algorithm // // public constructors // public InfoCardRSAPKCS1SignatureDeformatter() : base() {} public InfoCardRSAPKCS1SignatureDeformatter( 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 bool VerifySignature( byte[] rgbHash, byte[] rgbSignature ) { if ( !( m_strOID == null || m_rsaKey == null || rgbHash == null || rgbSignature == null ) && m_rsaKey is InfoCardRSACryptoProvider ) { return ((InfoCardRSACryptoProvider) m_rsaKey).VerifyHash(rgbHash, m_strOID, rgbSignature); } else { return base.VerifySignature( rgbHash, rgbSignature ); } } } } // 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 InfoCardRSAPKCS1SignatureDeformatter : RSAPKCS1SignatureDeformatter { private RSA m_rsaKey; // RSA Key value to do decrypt operation private string m_strOID; // OID value for the HASH algorithm // // public constructors // public InfoCardRSAPKCS1SignatureDeformatter() : base() {} public InfoCardRSAPKCS1SignatureDeformatter( 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 bool VerifySignature( byte[] rgbHash, byte[] rgbSignature ) { if ( !( m_strOID == null || m_rsaKey == null || rgbHash == null || rgbSignature == null ) && m_rsaKey is InfoCardRSACryptoProvider ) { return ((InfoCardRSACryptoProvider) m_rsaKey).VerifyHash(rgbHash, m_strOID, rgbSignature); } else { return base.VerifySignature( rgbHash, rgbSignature ); } } } } // 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
- Expression.cs
- PointCollection.cs
- SoapExtension.cs
- Parallel.cs
- RoleBoolean.cs
- cookieexception.cs
- ParameterReplacerVisitor.cs
- DataMemberFieldConverter.cs
- TrackingMemoryStreamFactory.cs
- ComplexBindingPropertiesAttribute.cs
- NameService.cs
- DocumentPaginator.cs
- ListViewCommandEventArgs.cs
- CodePageUtils.cs
- Buffer.cs
- ConnectionPoint.cs
- MenuItem.cs
- XmlLanguage.cs
- ResponseStream.cs
- MouseActionConverter.cs
- DeflateInput.cs
- RadioButtonFlatAdapter.cs
- BuildProviderCollection.cs
- InkSerializer.cs
- SpecularMaterial.cs
- DictionaryItemsCollection.cs
- Soap12FormatExtensions.cs
- UserCancellationException.cs
- PersianCalendar.cs
- FixedTextContainer.cs
- MailSettingsSection.cs
- ToolZone.cs
- HighlightVisual.cs
- MouseEventArgs.cs
- ObjectViewQueryResultData.cs
- MoveSizeWinEventHandler.cs
- PagerStyle.cs
- DnsPermission.cs
- MouseGestureConverter.cs
- DataList.cs
- OutputCacheSettings.cs
- ProgressBarRenderer.cs
- IPAddressCollection.cs
- httpapplicationstate.cs
- MenuTracker.cs
- ToolStripPanelCell.cs
- FieldToken.cs
- CompilationLock.cs
- Set.cs
- DescendantOverDescendantQuery.cs
- WebPartCloseVerb.cs
- CharEnumerator.cs
- HexParser.cs
- RepeatButton.cs
- shaperfactory.cs
- AuthenticationModuleElement.cs
- DragStartedEventArgs.cs
- TextMarkerSource.cs
- TimeBoundedCache.cs
- BaseDataListComponentEditor.cs
- ListControlDataBindingHandler.cs
- Module.cs
- XmlResolver.cs
- DesignerCatalogPartChrome.cs
- Camera.cs
- App.cs
- IDReferencePropertyAttribute.cs
- CredentialCache.cs
- StringReader.cs
- CqlParserHelpers.cs
- basevalidator.cs
- CompareValidator.cs
- ValidatingPropertiesEventArgs.cs
- StorageBasedPackageProperties.cs
- EventRouteFactory.cs
- MachineKeyValidationConverter.cs
- DialogResultConverter.cs
- IteratorDescriptor.cs
- MILUtilities.cs
- Argument.cs
- DataObjectPastingEventArgs.cs
- Point3DAnimationUsingKeyFrames.cs
- smtpconnection.cs
- EventData.cs
- StringTraceRecord.cs
- ScaleTransform.cs
- UriExt.cs
- NegationPusher.cs
- CustomPeerResolverService.cs
- RemoteWebConfigurationHostServer.cs
- WindowsUserNameSecurityTokenAuthenticator.cs
- XPathBinder.cs
- SortedList.cs
- TransportContext.cs
- UInt64Converter.cs
- RecoverInstanceLocksCommand.cs
- MessageQueueCriteria.cs
- StorageComplexTypeMapping.cs
- StagingAreaInputItem.cs
- ShapingWorkspace.cs