uint16_t ec_export_len(ec_cert_t *c, uint8_t export_flags);
size_t ec_export_len_64(ec_cert_t *c, uint8_t export_flags);
ec_export_len(), except returns the buffer length required to export to base64.
size_t ec_export(unsigned char *dest, ec_cert_t *c, uint8_t export_flags);
char *ec_export_64(char *dest, ec_cert_t *c, uint8_t export_flags);
ec_export(), except that the certificate is base64-encoded and armoured before writing to
deston success, or NULL on failure.
ec_cert_t *ec_import(unsigned char *src, size_t length, size_t *consumed);
consumedis not NULL, then the number of bytes consumed from
srcwill be stored there. On error, this value is considered undefined.
EC_CHECK_CERTbefore returning - if it does not pass, the import is considered to have failed and NULL is returned.
ec_cert_t *ec_import_64(char *src, size_t length, size_t *consumed);
ec_import(), except interprets the buffer as armoured and base64-encoded. The certificate may be present at any offset in the buffer, provided that the envelope is intact.