Code:
/ DotNET / DotNET / 8.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
- TypedTableBaseExtensions.cs
- InstanceOwnerException.cs
- UpdateTracker.cs
- AttributeEmitter.cs
- XmlDataCollection.cs
- QueueProcessor.cs
- _SpnDictionary.cs
- ElementFactory.cs
- FixedDocumentSequencePaginator.cs
- PropertyMapper.cs
- BindToObject.cs
- TransformerTypeCollection.cs
- KnownBoxes.cs
- TextElementEnumerator.cs
- CompatibleComparer.cs
- CaseInsensitiveHashCodeProvider.cs
- XmlSchema.cs
- SafePipeHandle.cs
- GenerateHelper.cs
- RawStylusInputCustomDataList.cs
- InvalidFilterCriteriaException.cs
- StringInfo.cs
- Converter.cs
- PrivilegedConfigurationManager.cs
- MbpInfo.cs
- ResourceDefaultValueAttribute.cs
- MetafileHeaderEmf.cs
- RoleManagerEventArgs.cs
- PropertyIdentifier.cs
- DbProviderSpecificTypePropertyAttribute.cs
- ProfileGroupSettings.cs
- XmlFormatExtensionPrefixAttribute.cs
- XmlObjectSerializerWriteContext.cs
- ContainerParagraph.cs
- mda.cs
- Cursors.cs
- HelpEvent.cs
- SharedPersonalizationStateInfo.cs
- XmlSerializerSection.cs
- FixUpCollection.cs
- CodeExpressionCollection.cs
- XhtmlCssHandler.cs
- Metadata.cs
- ItemAutomationPeer.cs
- Internal.cs
- SmiSettersStream.cs
- MailDefinitionBodyFileNameEditor.cs
- Transform3DGroup.cs
- RectangleGeometry.cs
- SqlCommandSet.cs
- TypeInformation.cs
- VisualStyleTypesAndProperties.cs
- Graph.cs
- WebPartDesigner.cs
- PerformanceCounterNameAttribute.cs
- ExtenderProvidedPropertyAttribute.cs
- CodeVariableReferenceExpression.cs
- PropertyManager.cs
- CheckBoxFlatAdapter.cs
- NativeRecognizer.cs
- ToggleButton.cs
- ToolStripLocationCancelEventArgs.cs
- HotCommands.cs
- MetadataArtifactLoaderComposite.cs
- DataObjectMethodAttribute.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- EncryptedPackage.cs
- Color.cs
- ButtonAutomationPeer.cs
- TraceSource.cs
- EnumerableRowCollectionExtensions.cs
- TextContainerChangeEventArgs.cs
- DataServiceContext.cs
- TypePresenter.xaml.cs
- DispatcherExceptionFilterEventArgs.cs
- DefaultTraceListener.cs
- TrackingWorkflowEventArgs.cs
- StringAnimationUsingKeyFrames.cs
- ActivityPreviewDesigner.cs
- SmtpLoginAuthenticationModule.cs
- GeneralTransformGroup.cs
- DBConnectionString.cs
- HttpConfigurationSystem.cs
- SchemaNamespaceManager.cs
- SourceItem.cs
- SafeIUnknown.cs
- SystemIPv6InterfaceProperties.cs
- XmlSchemaComplexContentRestriction.cs
- IgnoreDeviceFilterElementCollection.cs
- CheckPair.cs
- XmlUtil.cs
- ToolZone.cs
- PopupControlService.cs
- ProcessModelSection.cs
- CompilationLock.cs
- StringOutput.cs
- DocumentPageView.cs
- FixedPosition.cs
- MaterialCollection.cs
- HttpContext.cs