MessageSigner(X509Certificate2, Oid2) Constructor

Initializes a new instance of the MessageSigner class from signer certificate and client-provided hash algorithm.

Definition

Namespace: SysadminsLV.PKI.Tools.MessageOperations
Assembly: SysadminsLV.PKI.Win (in SysadminsLV.PKI.Win.dll) Version: 4.0.1.0 (4.0.1.0)
C#
public MessageSigner(
	X509Certificate2 signer,
	Oid2 hashAlgorithm
)

Parameters

signer  X509Certificate2
Signer certificate with associated private key.
hashAlgorithm  Oid2
Hash algorithm that is used to calculate the hash during signing or signature verification processes.

Remarks

Currently the following hash algorithms are supported:
  • MD5
  • SHA1
  • SHA256
  • SHA384
  • SHA512
Hash algorithm is ignored for DSA keys and is automatically set to 'SHA1'.

Exceptions

ArgumentExceptionhashAlgorithm parameter contains invalid hash algorithm identifier.
UninitializedObjectExceptionSigner certificate is not initialized.
ArgumentNullExceptionsigner and/or hashAlgorithm parameter is null.

See Also