KEYRING(3)

NAME
keyring - routines to manipulate a keyring

SYNOPSIS
#include <stdio.h>
#include <pgplib.h>
int
get_keyentry_from_buf(u_char *buf, int len, res_t *what, PGPsig_t **sig, PGPuserid_t **uid, PGPseckey_t **seckey, int *used);
int
get_keyentry_from_file(FILE *fd, res_t *what, PGPsig_t **sig, PGPuserid_t **uid, PGPseckey_t **seckey);
int
get_seckey_from_buf(u_char *buf, int len, PGPseckey_t **key);
int
get_seckey_from_file(FILE *fd, PGPseckey_t **key);

DESCRIPTION
The routines get_keyentry_from_buf() and get_keyentry_from_file() are low-level routines to parse keyrings as written by PGP. what determines which type of packet was found, and if the appropriate pointer was non-NULL, a packet was allocated (by means of malloc) and filled in. The two routines get_seckey_from_buf() and get_seckey_from_file() are high level routines using the former two.

RETURN VALUES
Upon success 0 is returned. If an error occurs, -1 is returned. If no packet could be found or a syntax error was detected, 1 is returned.

SEE ALSO
free_pubkey(PGPlib) free_seckey(PGPlib) free_uid(PGPlib) PGPlib(PBPlib) Passing in random data, especially in a buffer, is likely to lead to undesired results. The keyring is assumed to be RFC1991 compliant. Written by Tage Stabell-Kulų. First appeared in PGPlib 0.1