UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software

rocketsoftware.com
from rocketsoftware.com More from this publisher
11.04.2013 Views

SIGNATURE Syntax SIGNATURE(algorithm, action, data, dataLoc, key, keyLoc, keyFmt, pass, sigIn, result) Description The SIGNATURE() function generates a digital signature or verifies a signature using the supplied key. The algorithm parameter specifies the digest algorithm used to construct the signature. UniData supports the MD5 and SHA1 algorithms. There are four actions you can be specify: RSA-Sign, RSA-Verify, DSA-Sign, and DSA-Verify. If you choose DSA, you can only specify SHA1 in algorithm. The data to be signed or verified against a signature can be supplied either directly in data, or read from a file whose names is in data. For signing action, you should specify a private key. For verification, a public key is usually expected. However, UniData also accepts a private key for verification purposes. Key can be either in PEM or DER format. If a private key is password protected, the password must be supplied with pass. For verification, key can also contain a certificate or name of a certificate file. A signature is expected in sigIn. For signing action, the generated signature is put into result. 1-740 UniBasic Commands Reference

Parameters The following table describes each parameter of the syntax. Parameter Description algorithm The digest algorithm used for signing or verification (must be either “MD5” or “SHA1”). action 1 - RSA-Sign 2 - RSA-Verify 3 - DSA-Sign 4 - DSA-Verify data Data or the name of the file containing the data to be signed or verified. dataLoc 1 - Data in a string 2 - Data in a file key The key or the name of the file containing the key to be used to sign or verify. In the case of verification, key can be a certificate string or a file. keyLoc 1 - Key is in a string 2 - Key is in a file 3 - Key is in a certificate for verification keyFmt 1 - PEM 2 - DER pass A string containing the pass phrase for the private key. sigIn A string containing a digital signature. result A generated signature or a file to store the signature. SIGNATURE Parameters The following table describes the status of each return code. Return Code Status 0 Success. 1 Unsupported digest algorithm. 2 The data cannot be read. Return Code Status SIGNATURE 1-741

Parameters<br />

The following table describes each parameter of the syntax.<br />

Parameter Description<br />

algorithm The digest algorithm used for signing or verification (must be either<br />

“MD5” or “SHA1”).<br />

action 1 - RSA-Sign<br />

2 - RSA-Verify<br />

3 - DSA-Sign<br />

4 - DSA-Verify<br />

data Data or the name of the file containing the data to be signed or verified.<br />

dataLoc 1 - Data in a string<br />

2 - Data in a file<br />

key The key or the name of the file containing the key to be used to sign or<br />

verify. In the case of verification, key can be a certificate string or a file.<br />

keyLoc 1 - Key is in a string<br />

2 - Key is in a file<br />

3 - Key is in a certificate for verification<br />

keyFmt 1 - PEM<br />

2 - DER<br />

pass A string containing the pass phrase for the private key.<br />

sigIn A string containing a digital signature.<br />

result A generated signature or a file to store the signature.<br />

SIGNATURE Parameters<br />

The following table describes the status of each return code.<br />

Return<br />

Code Status<br />

0 Success.<br />

1 Unsupported digest algorithm.<br />

2 The data cannot be read.<br />

Return Code Status<br />

SIGNATURE 1-741

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!