PUBKEY(3)

NAME
pubkey - routines to manipulate public keys

SYNOPSIS
#include <pgplib.h>
int
pubkey2buf(PGPpubkey_t key, u_char **buf);
int
buf2pubkey(u_char *buf, int len, PGPpubkey_t *key);
PGPpubkey_t *
copy_pubkey(PGPppubkey_t *key);
void
free_pubkey(PGPpubkey_t *key);

DESCRIPTION
These routines manipulate public keys. pubkey2buf() and buf2pubkey() operate on a package compatible with RFC1991. The size of the buffer returned by the former can be found with get_packetlen(). copy_pubkey() will allocate space for the new key (and its internal state), including the space for the structure itself while free_pubkey() only frees the internal state (and not the space occupied by the structure).

RETURN VALUES
Upon success 0 is returned. If an error occurs, -1 is returned. buf2pubkey() will return 1 if there is a syntax error in the input.

SEE ALSO
malloc(3) free(3) get_packetlen(PGPlib) PGPlib(3)

STANDARDS
The packet generated by signature2buf() is compatible with the format described in RFC1991.

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