msgsign
msgsign |
Purpose
Synopsis
function msgsign(mdalg:string, pkey:string, fname:string, sgf:string):integer
function msgsign(fname:string, sgf:string):integer
Arguments
mdalg
|
Name of the message digest algorithm to use
|
pkey
|
Name of the private key file to use for signing
|
fname
|
File to sign
|
sgf
|
File where the signature is to be saved
|
Return value
Length of the signature or
-1 in the case of an error.
Further information
1. This function computes the digital signature of a document by encrypting the message digest of its input file using an RSA private key. The resulting signature can be verified with the function
msgverify used with the appropriate public key.
2. If no message digest algorithm is specified, the default algorithm defined by the control parameter
ssl_digest is used. Unless a specific key file is selected, the default private key defined by the control parameter
ssl_privkey or, (if this parameter is not defined) the key under
getparam("ssl_dir")+"/personal.key" is used.
Related topics
Module