Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / clr / src / BCL / System / Security / Cryptography / DSASignatureDeformatter.cs / 1 / DSASignatureDeformatter.cs
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
//
// DSASignatureDeformatter.cs
//
namespace System.Security.Cryptography {
[System.Runtime.InteropServices.ComVisible(true)]
public class DSASignatureDeformatter : AsymmetricSignatureDeformatter {
DSA _dsaKey; // DSA Key value to do decrypt operation
string _oid;
//
// public constructors
//
public DSASignatureDeformatter() {
// The hash algorithm is always SHA1
_oid = CryptoConfig.MapNameToOID("SHA1");
}
public DSASignatureDeformatter(AsymmetricAlgorithm key) : this() {
if (key == null)
throw new ArgumentNullException("key");
_dsaKey = (DSA) key;
}
//
// public methods
//
public override void SetKey(AsymmetricAlgorithm key) {
if (key == null)
throw new ArgumentNullException("key");
_dsaKey = (DSA) key;
}
public override void SetHashAlgorithm(string strName) {
if (CryptoConfig.MapNameToOID(strName) != _oid)
throw new CryptographicUnexpectedOperationException(Environment.GetResourceString("Cryptography_InvalidOperation"));
}
public override bool VerifySignature(byte[] rgbHash, byte[] rgbSignature) {
if (_dsaKey == null)
throw new CryptographicUnexpectedOperationException(Environment.GetResourceString("Cryptography_MissingKey"));
if (rgbHash == null)
throw new ArgumentNullException("rgbHash");
if (rgbSignature == null)
throw new ArgumentNullException("rgbSignature");
return _dsaKey.VerifySignature(rgbHash, rgbSignature);
}
}
}
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Listbox.cs
- FormsIdentity.cs
- ToolStripDropDownMenu.cs
- ConvertTextFrag.cs
- NameValueConfigurationElement.cs
- Win32SafeHandles.cs
- MimeWriter.cs
- arabicshape.cs
- DataGridTableStyleMappingNameEditor.cs
- CheckPair.cs
- SqlLiftIndependentRowExpressions.cs
- CssTextWriter.cs
- CompensableActivity.cs
- InputLanguage.cs
- StrongNameIdentityPermission.cs
- TwoPhaseCommitProxy.cs
- jithelpers.cs
- ResizeGrip.cs
- Utils.cs
- URL.cs
- ConnectionString.cs
- WindowsAuthenticationModule.cs
- BitmapVisualManager.cs
- FilterException.cs
- Typeface.cs
- HtmlTernaryTree.cs
- Wizard.cs
- WindowsListViewItemCheckBox.cs
- SafeNativeMethods.cs
- MouseButton.cs
- IdentitySection.cs
- COSERVERINFO.cs
- MemberRelationshipService.cs
- TypeConverter.cs
- NullableConverter.cs
- ReferentialConstraint.cs
- ArgumentException.cs
- CanExecuteRoutedEventArgs.cs
- FreezableCollection.cs
- IdentityReference.cs
- PageWrapper.cs
- TrackBar.cs
- MasterPageBuildProvider.cs
- DataViewListener.cs
- CellCreator.cs
- Win32.cs
- StrongName.cs
- XmlEntityReference.cs
- LazyTextWriterCreator.cs
- EntitySqlQueryBuilder.cs
- XmlUrlResolver.cs
- Point4DValueSerializer.cs
- InvalidWMPVersionException.cs
- PropertyGeneratedEventArgs.cs
- FrameworkElementFactoryMarkupObject.cs
- NavigationWindowAutomationPeer.cs
- RangeEnumerable.cs
- ExtensionElementCollection.cs
- DataSvcMapFileSerializer.cs
- FormViewUpdatedEventArgs.cs
- ComponentResourceManager.cs
- DataSourceSelectArguments.cs
- UICuesEvent.cs
- StringAttributeCollection.cs
- RoutedEventArgs.cs
- DecimalAnimationBase.cs
- PersonalizationStateInfoCollection.cs
- XmlCountingReader.cs
- ConfigXmlAttribute.cs
- _SslSessionsCache.cs
- DrawingVisual.cs
- DecimalKeyFrameCollection.cs
- PathGeometry.cs
- TraceUtility.cs
- InstanceDataCollectionCollection.cs
- XmlEventCache.cs
- GenericWebPart.cs
- SqlUtil.cs
- ConvertBinder.cs
- TypeUsage.cs
- ContextMarshalException.cs
- IgnoreSectionHandler.cs
- ComponentChangedEvent.cs
- EventListener.cs
- TdsParserStateObject.cs
- XmlDocumentViewSchema.cs
- HttpStreamXmlDictionaryWriter.cs
- RegexNode.cs
- HTTPNotFoundHandler.cs
- StringUtil.cs
- ITextView.cs
- DocumentGridPage.cs
- KeyedCollection.cs
- GridPattern.cs
- SynchronizedInputHelper.cs
- RichTextBoxConstants.cs
- TemplateBuilder.cs
- ReaderContextStackData.cs
- ToolStripItemClickedEventArgs.cs
- XPathNode.cs