| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- //
- // System.Security.Cryptography AsymmetricSignatureFormatter Class implementation
- //
- // Authors:
- // Thomas Neidhart ([email protected])
- //
- using System;
- using System.Security;
- namespace System.Security.Cryptography {
-
- /// <summary>
- /// Abstract base class for all asymmetric signature formatter.
- /// Available derived classes:
- /// DSASignatureFormatter, RSAPKCS1SignatureFormatter
- /// </summary>
- public abstract class AsymmetricSignatureFormatter {
-
- /// <summary>
- /// constructor, no idea why it is here (abstract class) :-)
- /// just for compatibility with MS
- /// </summary>
- public AsymmetricSignatureFormatter()
- {
- }
-
- /// <summary>
- /// Sets the hash algorithm used for verifying a signature
- /// </summary>
- public abstract void SetHashAlgorithm(string strName);
-
- /// <summary>
- /// set the private key
- /// </summary>
- public abstract void SetKey(AsymmetricAlgorithm key);
-
- /// <summary>
- /// Create a signature from the given data
- /// </summary>
- public abstract byte[] CreateSignature(byte[] rgbHash);
- /// <summary>
- /// Create a signature from data with the specified hash algorithm
- /// </summary>
- public virtual byte[] CreateSignature(HashAlgorithm hash)
- {
- if (hash == null)
- throw new ArgumentNullException ("hash");
- return CreateSignature (hash.Hash);
- }
-
- } // AsymmetricSignatureFormatter
-
- } // System.Security.Cryptography
|