16 return Create(
"System.Security.Cryptography.DSA");
37 public abstract bool VerifySignature(
byte[] rgbHash,
byte[] rgbSignature);
48 throw DerivedClassMustOverride();
58 throw DerivedClassMustOverride();
75 return SignData(data, 0, data.Length, hashAlgorithm);
98 if (offset < 0 || offset > data.Length)
102 if (count < 0 || count > data.Length - offset)
106 if (
string.IsNullOrEmpty(hashAlgorithm.
Name))
108 throw HashAlgorithmNameNullOrEmpty();
110 byte[] rgbHash =
HashData(data, offset, count, hashAlgorithm);
128 if (
string.IsNullOrEmpty(hashAlgorithm.
Name))
130 throw HashAlgorithmNameNullOrEmpty();
132 byte[] rgbHash =
HashData(data, hashAlgorithm);
153 return VerifyData(data, 0, data.Length, signature, hashAlgorithm);
179 if (offset < 0 || offset > data.Length)
183 if (count < 0 || count > data.Length - offset)
187 if (signature ==
null)
191 if (
string.IsNullOrEmpty(hashAlgorithm.
Name))
193 throw HashAlgorithmNameNullOrEmpty();
195 byte[] rgbHash =
HashData(data, offset, count, hashAlgorithm);
216 if (signature ==
null)
220 if (
string.IsNullOrEmpty(hashAlgorithm.
Name))
222 throw HashAlgorithmNameNullOrEmpty();
224 byte[] rgbHash =
HashData(data, hashAlgorithm);
234 if (xmlString ==
null)
239 Parser parser =
new Parser(xmlString);
241 string text = topElement.SearchForTextOfLocalName(
"P");
247 string text2 = topElement.SearchForTextOfLocalName(
"Q");
253 string text3 = topElement.SearchForTextOfLocalName(
"G");
259 string text4 = topElement.SearchForTextOfLocalName(
"Y");
265 string text5 = topElement.SearchForTextOfLocalName(
"J");
270 string text6 = topElement.SearchForTextOfLocalName(
"X");
275 string text7 = topElement.SearchForTextOfLocalName(
"Seed");
276 string text8 = topElement.SearchForTextOfLocalName(
"PgenCounter");
277 if (text7 !=
null && text8 !=
null)
282 else if (text7 !=
null || text8 !=
null)
301 stringBuilder.
Append(
"<DSAKeyValue>");
306 if (dSAParameters.
J !=
null)
310 if (dSAParameters.
Seed !=
null)
315 if (includePrivateParameters)
319 stringBuilder.
Append(
"</DSAKeyValue>");
333 private static Exception DerivedClassMustOverride()
338 internal static Exception HashAlgorithmNameNullOrEmpty()
The exception that is thrown when an error occurs during a cryptographic operation.
Converts a base data type to another base data type.
virtual bool VerifyData(Stream data, byte[] signature, HashAlgorithmName hashAlgorithm)
Verifies that a digital signature is valid by calculating the hash value of the specified stream usin...
static new DSA Create(string algName)
Creates the specified cryptographic object used to perform the asymmetric algorithm.
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
byte [] J
Specifies the J parameter for the T:System.Security.Cryptography.DSA algorithm.
override string ToXmlString(bool includePrivateParameters)
Creates and returns an XML string representation of the current T:System.Security....
unsafe override string ToString()
Converts the value of this instance to a T:System.String.
abstract void ImportParameters(DSAParameters parameters)
When overridden in a derived class, imports the specified T:System.Security.Cryptography....
string Name
Gets the underlying string representation of the algorithm name.
byte [] P
Specifies the P parameter for the T:System.Security.Cryptography.DSA algorithm.
byte [] X
Specifies the X parameter for the T:System.Security.Cryptography.DSA algorithm.
static object CreateFromName(string name, params object[] args)
Creates a new instance of the specified cryptographic object with the specified arguments.
The exception that is thrown when the value of an argument is outside the allowable range of values a...
static new DSA Create()
Creates the default cryptographic object used to perform the asymmetric algorithm.
byte [] Q
Specifies the Q parameter for the T:System.Security.Cryptography.DSA algorithm.
byte [] SignData(byte[] data, HashAlgorithmName hashAlgorithm)
Computes the hash value of the specified byte array using the specified hash algorithm and signs the ...
Specifies the name of a cryptographic hash algorithm.
virtual byte [] HashData(Stream data, HashAlgorithmName hashAlgorithm)
When overridden in a derived class, computes the hash value of a specified binary stream by using a s...
static string ToBase64String(byte[] inArray)
Converts an array of 8-bit unsigned integers to its equivalent string representation that is encoded ...
byte [] Seed
Specifies the seed for the T:System.Security.Cryptography.DSA algorithm.
Represents the abstract base class from which all implementations of the Digital Signature Algorithm ...
Provides information about, and means to manipulate, the current environment and platform....
abstract DSAParameters ExportParameters(bool includePrivateParameters)
When overridden in a derived class, exports the T:System.Security.Cryptography.DSAParameters.
StringBuilder Append(char value, int repeatCount)
Appends a specified number of copies of the string representation of a Unicode character to this inst...
Accesses the cryptography configuration information.
Represents the XML object model for encoding security objects. This class cannot be inherited.
byte [] Y
Specifies the Y parameter for the T:System.Security.Cryptography.DSA algorithm.
Represents the abstract base class from which all implementations of asymmetric algorithms must inher...
virtual byte [] HashData(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm)
When overridden in a derived class, computes the hash value of a specified portion of a byte array by...
Represents a mutable string of characters. This class cannot be inherited.To browse the ....
byte [] G
Specifies the G parameter for the T:System.Security.Cryptography.DSA algorithm.
The exception that is thrown when one of the arguments provided to a method is not valid.
bool VerifyData(byte[] data, byte[] signature, HashAlgorithmName hashAlgorithm)
Verifies that a digital signature is valid by calculating the hash value of the specified data using ...
static unsafe byte [] FromBase64String(string s)
Converts the specified string, which encodes binary data as base-64 digits, to an equivalent 8-bit un...
Represents errors that occur during application execution.To browse the .NET Framework source code fo...
abstract bool VerifySignature(byte[] rgbHash, byte[] rgbSignature)
When overridden in a derived class, verifies the T:System.Security.Cryptography.DSA signature for the...
virtual byte [] SignData(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm)
Computes the hash value of a portion of the specified byte array using the specified hash algorithm a...
virtual byte [] SignData(Stream data, HashAlgorithmName hashAlgorithm)
Computes the hash value of the specified stream using the specified hash algorithm and signs the resu...
virtual bool VerifyData(byte[] data, int offset, int count, byte[] signature, HashAlgorithmName hashAlgorithm)
Verifies that a digital signature is valid by calculating the hash value of the data in a portion of ...
override void FromXmlString(string xmlString)
Reconstructs a T:System.Security.Cryptography.DSA object from an XML string.
int Counter
Specifies the counter for the T:System.Security.Cryptography.DSA algorithm.
abstract byte [] CreateSignature(byte[] rgbHash)
When overridden in a derived class, creates the T:System.Security.Cryptography.DSA signature for the ...
The exception that is thrown when a requested method or operation is not implemented.
Contains the typical parameters for the T:System.Security.Cryptography.DSA algorithm.
Provides a generic view of a sequence of bytes. This is an abstract class.To browse the ....