DECRYPT_SECKEY(3)

NAME
decrypt_seckey - decrypt the secret fields in a secret key

SYNOPSIS
#include <pgplib.h>
int
decrypt_seckey(PGPseckey_t *old, u_char digest[16], PGPsecket_t *new);
void
clear_seckey(PGPseckey_t *key);

DESCRIPTION
Before a secret key can be used, the secret fields must be decrypted. They are protected by encryption, with a MD5 hash of the users' password as key. The key old is supposed to contain encrypted fields.

All secrets can be wiped away by clear_seckey.

RETURN VALUES
Upon success 0 is returned. If the key (or digest) is incorrect, 1 is returned. If an error occurs, -1 is returned. The key pointed to by new will contain the "armed" version of the key. An armed key is distinguished from an unarmed one by having the algorithm field set to 0 (zero).

SEE ALSO
seckey(3) md5 PGPlib(3)

WARNING
The key new contains Life, Universe and Everything. Use it with care, and be sure to call clear_seckey at the earliest possible moment.

BUGS
The return codes should be more verbose (more of them).

HISTORY
Written by Tage Stabell-Kulų. First appeared in PGPlib 0.1