CryptoSys PKI Pro Manual

sigSignData

Compute a signature value over data in a byte array.

Syntax

[VBA]
Public Function sigSignData ( _
    lpData() As Byte, _
    szKeyFile As String, _
    szPassword As String, _
    szAlgName As String, _
    Optional nOptions As Long = 0 _
) As String

Parameters

lpData
Data to be signed.
szKeyFile
name of the private key file or a string containing the key in PEM format, or a valid internal private key string.
szPassword
Password for the private key, or "" if not required.
szAlgName
Signature algorithm to be used:
"sha1WithRSAEncryption"
"sha224WithRSAEncryption"
"sha256WithRSAEncryption"
"sha384WithRSAEncryption"
"sha512WithRSAEncryption"
"md5WithRSAEncryption"
"ecdsaWithSHA1"
"ecdsaWithSHA224"
"ecdsaWithSHA256"
"ecdsaWithSHA384"
"ecdsaWithSHA512"
"RSA-PSS-SHA1"
"RSA-PSS-SHA224"
"RSA-PSS-SHA256"
"RSA-PSS-SHA384"
"RSA-PSS-SHA512"
"Ed25519"
nOptions
Use 0 for defaults.
Add the bitflag PKI_SIG_USEDIGEST to pass the digest value of the data-to-be-signed as the lpData argument.
To change the format of the output (default base64 encoded), add one of:
PKI_ENCODE_BASE64URL
PKI_ENCODE_HEX
Options for ECDSA signatures only:
PKI_SIG_DETERMINISTIC
PKI_SIG_ASN1DER
Options for RSA-PSS signatures only to set the salt length (default = hLen):
PKI_PSS_SALTLEN_HLEN
PKI_PSS_SALTLEN_MAX
PKI_PSS_SALTLEN_20
PKI_PSS_SALTLEN_ZERO
and, optionally, add PKI_MGF_MGF1SHA1 (RSA-PSS only) to force the MGF hash function to be SHA-1 (default = same as signature hash algorithm).

Return Value

String: The signature encoded in base64, or an empty string on error.
[PREV: rsaToXMLStringEx...]   [Contents]   [Index]   
   [NEXT: sigSignFile...]

Copyright © 2004-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-09-23T07:52:09Z.