Welcome to mirror list, hosted at ThFree Co, Russian Federation.

AsymmetricSignatureDeformatter.cs « System.Security.Cryptography « corlib « class « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 55abce71c5c4cd11d17a5861433f07f27a0445fe (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 AsymmetricSignatureDeformatter 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 deformatter.
	/// Available derived classes:
	/// DSASignatureDeformatter, RSAPKCS1SignatureDeformatter
	/// </summary>
	public abstract class AsymmetricSignatureDeformatter {
		
		/// <summary>
		/// constructor, no idea why it is here (abstract class)  :-)
		/// just for compatibility with MS
		/// </summary>
		public AsymmetricSignatureDeformatter() {
		}
		
		/// <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>
		/// Verifies the given Signature
		/// </summary>
		public abstract bool VerifySignature(byte[] rgbHash, byte[] rgbSignature);

		/// <summary>
		/// Verifies the given Signature with the given hash algorithm
		/// </summary>
		public virtual bool VerifySignature(HashAlgorithm hash, byte[] rgbSignature) {
			return VerifySignature(hash.Hash, rgbSignature);
		}
		
	} // AsymmetricSignatureDeformatter
	
} // System.Security.Cryptography