/** Allocate and return storage for a public key. The key itself will not yet * be set. */ crypto_pk_t *crypto_pk_new(void) { RSA *rsa; rsa = RSA_new(); // assert(rsa); return crypto_new_pk_from_rsa_(rsa); }
/** Set <b>out</b> to the hex-encoded fingerprint of <b>pkey</b>. */ static int get_digest(EVP_PKEY *pkey, char *out) { int r = 1; crypto_pk_t *pk = crypto_new_pk_from_rsa_(EVP_PKEY_get1_RSA(pkey)); if (pk) { r = crypto_pk_get_digest(pk, out); crypto_pk_free(pk); } return r; }