STORE_PUBKEY(3)

NAME
store_pubkey - store a public key

SYNOPSIS
#include <pgplib.h>
int
store_pubkey(PGPpubkey_t key, repl_t replace);

DESCRIPTION
The public key key is stored in the database. If the key, identified by the key identifier (64 bits) is already present in the database, the action depends on the value of replace. This value can be either INSERT or REPLACE with the obvious meanings. In addition to storage of the actual key, the "short" identifier is also extracted and added to the database for later retrieval.

RETURN VALUES
If no error occured, 0 is returned. If the key itself was added but there was a problem adding the "short" key identifier, 1 is returned. On error, -1 is returned.

SEE ALSO
dbopen(3) find_shortid(PGPlib) keydb_init(PGPlib) store_pubkey_record(PGPlib)

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