MessageSigner Constructor (X509Certificate2, Oid2) |
Initializes a new instance of the MessageSigner class from signer certificate and
client-provided hash algorithm.
Namespace:
SysadminsLV.PKI.Tools.MessageOperations
Assembly:
SysadminsLV.PKI (in SysadminsLV.PKI.dll) Version: 3.7.0.0 (3.7.0.0)
Syntax public MessageSigner(
X509Certificate2 signer,
Oid2 hashAlgorithm
)
Public Sub New (
signer As X509Certificate2,
hashAlgorithm As Oid2
)
public:
MessageSigner(
X509Certificate2^ signer,
Oid2^ hashAlgorithm
)
new :
signer : X509Certificate2 *
hashAlgorithm : Oid2 -> MessageSigner
Parameters
- signer
- Type: System.Security.Cryptography.X509CertificatesX509Certificate2
Signer certificate with associated private key. - hashAlgorithm
- Type: System.Security.CryptographyOid2
Hash algorithm that is used to calculate the hash during signing or signature verification
processes.
Exceptions Exception | Condition |
---|
ArgumentException | hashAlgorithm parameter contains invalid hash algorithm identifier.
|
UninitializedObjectException | Signer certificate is not initialized. |
ArgumentNullException | signer and/or hashAlgorithm parameter is null.
|
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'.
See Also