Back to the Function Reference Table of Contents

Signature Functions

The Signature Functions create and verify detached signatures. For directly signing documents and files, see the Encryption Functions. For signatures on keys, see spgpKeySign and spgpKeySigRemove.

spgpDetachedSigCreate

Create a detached signature for a file.

Visual Basic declaration:

Declare Function spgpdetachedsigcreate Lib "spgp.dll" (
	ByVal FileIn As String, 
	ByVal SigFile As String, 
	ByVal SignKeyID As String, 
	ByVal SignKeyPass As String, 
	ByVal Comment As String,
	ByVal SignAlg As Long,
	ByVal Armor As Long
	) As Long

Parameters:
FileIn The file to sign. This must be a complete path and file name.
SigFile The signature file to create. This must be a complete path and file name.
SignKeyID Signer's private key ID, which can be either the e-mail address from the key's user-ID or the ID number of the key itself, which must be prefixed by "0x".
SignKeyPass Passphrase to access signer's private key.
Comment Comment string. This will be added below the "Version:" string in detached signatures which are not binary (Armor = 1). If Comment is blank ("") there will be no Comment.
SignAlg Hashing algorithm for a digital signature. For RSA keys only, SignAlg may be any one of the following:
"0" or the constant PGPHashAlgorithm_Default
"1" or the constant PGPHashAlgorithm_MD5
"2" or the constant PGPHashAlgorithm_SHA
"3" or the constant PGPHashAlgorithm_RIPEMD160
"4" or the constant PGPHashAlgorithm_SHADouble
A value of "0" indicates that the default algorithm for the signing key should be used. For RSA keys this is MD5, for all others it is SHA. DH/DSS (ElGamal) keys sign with SHA only. For such keys, a value other than "0" has no effect.
SHADouble is not available in PGP version 6.x.
Armor ASCII-armor output? May be 0 (false) or 1 (true). If false, SigFile will be binary; if true, SigFile will be in "ASCII Radix-64 format suitable for transporting through E-mail channels" (a.k.a. "transport armor").
Equivalent to the '-a' or +armor=on command-line options in PGP 2.6.x.

Notes and Warnings:

up to the top

spgpDetachedSigVerify

Verify the detached signature for a file.

Visual Basic declaration:

Declare Function spgpdetachedsigverify Lib "spgp.dll" (
	ByVal SigFile As String, 
	ByVal SignedFile As String, 
	ByVal SigProps As String
	) As Long

Parameters:
SigFile The signature file to verify. This must be a complete path and file name.
SignedFile The file to which the signature refers. This must be a complete path and file name.
SigProps Signature properties. See Signature Properties String.

Notes and Warnings:

up to the top
Back to the Function Reference Table of Contents