blob: 541b8a4faa3ba5ad895be678159c37764f34f61e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
//
// System.Security.Cryptography AsymmetricSignatureFormatter Class implementation
//
// Authors:
// Thomas Neidhart (tome@sbox.tugraz.at)
//
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) {
return CreateSignature(hash.Hash);
}
} // AsymmetricSignatureFormatter
} // System.Security.Cryptography
|