CryptSigner(X509Certificate2, Oid) Constructor

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

Definition

Namespace: SysadminsLV.PKI.Cryptography
Assembly: SysadminsLV.PKI (in SysadminsLV.PKI.dll) Version: 4.0.1
C#
public CryptSigner(
	X509Certificate2 certificate,
	Oid hashingAlgorithm
)

Parameters

certificate  X509Certificate2
Signer certificate with associated private key.
hashingAlgorithm  Oid
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.
ArgumentNullExceptionsigner and/or hashAlgorithm parameter is null.

See Also