CryptoSys PKI Pro Manual

sigSignFile

Compute a signature value over data in a file.

Syntax

[VBA]
Public Function sigSignFile ( _
    szDataFile As String, _
    szKeyFile As String, _
    szPassword As String, _
    szAlgName As String, _
    Optional nOptions As Long = 0 _
) As String

Parameters

szDataFile
Name of file 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"
nOptions
Use 0 for defaults.
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.

Remarks

Ed25519 is not available with this function. To sign using Ed25519, read in the file to a byte array and use sigSignData.
[PREV: sigSignData...]   [Contents]   [Index]   
   [NEXT: sigVerifyData...]

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