NAME

catcert_publickey - get the public key from a certificate

SYNOPSIS

#include <cat/cat.h>

int catcert_publickey(const cat_cert *cert, cat_data *key);

DESCRIPTION

This function extracts the public key from cert and stores the result in the supplied cat_data structure pointed to by key. The cat_data structure is defined as follows:

 struct cat_data {
    int len;
    char *data;
 };
 typedef struct cat_data cat_data;

The data member of the result is allocated and must be freed by the caller.

RETURN VALUES

The function returns 0 if successful, or a negative code on error.

SEE ALSO

cat, catcert, catcert_issuername