diff options
author | Richard Levitte <levitte@openssl.org> | 2020-07-30 10:09:43 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-08-20 12:37:35 +0200 |
commit | 2274d22d39fd65b83c9c969cba86c8f03b3e0bec (patch) | |
tree | dd86a9ea759bc5d2d1bd541afe0d28a929018e6d /doc | |
parent | 6cc1dfca88c565ddacd9ea9aa8261ef9c0c37335 (diff) |
STORE: Distinguish public keys from private keys
While public keys and private keys use the same type (EVP_PKEY), just
with different contents, callers still need to distinguish between the
two to be able to know what functions to call with them (for example,
to be able to choose between EVP_PKEY_print_private() and
EVP_PKEY_print_public()).
The OSSL_STORE backend knows what it loaded, so it has the capacity to
inform.
Note that the same as usual still applies, that a private key EVP_PKEY
contains the public parts, but not necessarily the other way around.
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/12673)
Diffstat (limited to 'doc')
-rw-r--r-- | doc/man3/OSSL_STORE_INFO.pod | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/doc/man3/OSSL_STORE_INFO.pod b/doc/man3/OSSL_STORE_INFO.pod index c331677954..bc965a77bd 100644 --- a/doc/man3/OSSL_STORE_INFO.pod +++ b/doc/man3/OSSL_STORE_INFO.pod @@ -3,15 +3,17 @@ =head1 NAME OSSL_STORE_INFO, OSSL_STORE_INFO_get_type, OSSL_STORE_INFO_get0_NAME, -OSSL_STORE_INFO_get0_NAME_description, OSSL_STORE_INFO_get0_PARAMS, +OSSL_STORE_INFO_get0_NAME_description, +OSSL_STORE_INFO_get0_PARAMS, OSSL_STORE_INFO_get0_PUBKEY, OSSL_STORE_INFO_get0_PKEY, OSSL_STORE_INFO_get0_CERT, OSSL_STORE_INFO_get0_CRL, OSSL_STORE_INFO_get1_NAME, OSSL_STORE_INFO_get1_NAME_description, -OSSL_STORE_INFO_get1_PARAMS, OSSL_STORE_INFO_get1_PKEY, -OSSL_STORE_INFO_get1_CERT, -OSSL_STORE_INFO_get1_CRL, OSSL_STORE_INFO_type_string, OSSL_STORE_INFO_free, +OSSL_STORE_INFO_get1_PARAMS, OSSL_STORE_INFO_get1_PUBKEY, +OSSL_STORE_INFO_get1_PKEY, OSSL_STORE_INFO_get1_CERT, OSSL_STORE_INFO_get1_CRL, +OSSL_STORE_INFO_type_string, OSSL_STORE_INFO_free, OSSL_STORE_INFO_new_NAME, OSSL_STORE_INFO_set0_NAME_description, -OSSL_STORE_INFO_new_PARAMS, OSSL_STORE_INFO_new_PKEY, OSSL_STORE_INFO_new_CERT, -OSSL_STORE_INFO_new_CRL - Functions to manipulate OSSL_STORE_INFO objects +OSSL_STORE_INFO_new_PARAMS, OSSL_STORE_INFO_new_PUBKEY, +OSSL_STORE_INFO_new_PKEY, OSSL_STORE_INFO_new_CERT, OSSL_STORE_INFO_new_CRL +- Functions to manipulate OSSL_STORE_INFO objects =head1 SYNOPSIS @@ -27,6 +29,8 @@ OSSL_STORE_INFO_new_CRL - Functions to manipulate OSSL_STORE_INFO objects char *OSSL_STORE_INFO_get1_NAME_description(const OSSL_STORE_INFO *store_info); EVP_PKEY *OSSL_STORE_INFO_get0_PARAMS(const OSSL_STORE_INFO *store_info); EVP_PKEY *OSSL_STORE_INFO_get1_PARAMS(const OSSL_STORE_INFO *store_info); + EVP_PKEY *OSSL_STORE_INFO_get0_PUBKEY(const OSSL_STORE_INFO *info); + EVP_PKEY *OSSL_STORE_INFO_get1_PUBKEY(const OSSL_STORE_INFO *info); EVP_PKEY *OSSL_STORE_INFO_get0_PKEY(const OSSL_STORE_INFO *store_info); EVP_PKEY *OSSL_STORE_INFO_get1_PKEY(const OSSL_STORE_INFO *store_info); X509 *OSSL_STORE_INFO_get0_CERT(const OSSL_STORE_INFO *store_info); @@ -41,6 +45,7 @@ OSSL_STORE_INFO_new_CRL - Functions to manipulate OSSL_STORE_INFO objects OSSL_STORE_INFO *OSSL_STORE_INFO_new_NAME(char *name); int OSSL_STORE_INFO_set0_NAME_description(OSSL_STORE_INFO *info, char *desc); OSSL_STORE_INFO *OSSL_STORE_INFO_new_PARAMS(DSA *dsa_params); + OSSL_STORE_INFO *OSSL_STORE_INFO_new_PUBKEY(EVP_PKEY *pubkey); OSSL_STORE_INFO *OSSL_STORE_INFO_new_PKEY(EVP_PKEY *pkey); OSSL_STORE_INFO *OSSL_STORE_INFO_new_CERT(X509 *x509); OSSL_STORE_INFO *OSSL_STORE_INFO_new_CRL(X509_CRL *crl); @@ -76,23 +81,27 @@ STORE_INFO_get_type_string() takes a STORE type number and returns a short string describing it. OSSL_STORE_INFO_get0_NAME(), OSSL_STORE_INFO_get0_NAME_description(), -OSSL_STORE_INFO_get0_PARAMS(), OSSL_STORE_INFO_get0_PKEY(), -OSSL_STORE_INFO_get0_CERT() and OSSL_STORE_INFO_get0_CRL() all take a -B<OSSL_STORE_INFO> and return the held object of the appropriate OpenSSL -type provided that's what's held. +OSSL_STORE_INFO_get0_PARAMS(), OSSL_STORE_INFO_get0_PUBKEY(), +OSSL_STORE_INFO_get0_PKEY(), OSSL_STORE_INFO_get0_CERT(), +OSSL_STORE_INFO_get0_CRL() +all take a B<OSSL_STORE_INFO> and return the object it holds if the +B<OSSL_STORE_INFO> type (as returned by OSSL_STORE_INFO_get_type()) +matches the function, otherwise NULL. OSSL_STORE_INFO_get1_NAME(), OSSL_STORE_INFO_get1_NAME_description(), -OSSL_STORE_INFO_get1_PARAMS(), OSSL_STORE_INFO_get1_PKEY(), -OSSL_STORE_INFO_get1_CERT() and OSSL_STORE_INFO_get1_CRL() all take a -B<OSSL_STORE_INFO> and return a duplicate of the held object of the -appropriate OpenSSL type provided that's what's held. +OSSL_STORE_INFO_get1_PARAMS(), OSSL_STORE_INFO_get1_PUBKEY(), +OSSL_STORE_INFO_get1_PKEY(), OSSL_STORE_INFO_get1_CERT() and +OSSL_STORE_INFO_get1_CRL() +all take a B<OSSL_STORE_INFO> and return a duplicate the object it +holds if the B<OSSL_STORE_INFO> type (as returned by +OSSL_STORE_INFO_get_type()) matches the function, otherwise NULL. OSSL_STORE_INFO_free() frees a B<OSSL_STORE_INFO> and its contained type. OSSL_STORE_INFO_new_NAME() , OSSL_STORE_INFO_new_PARAMS(), -OSSL_STORE_INFO_new_PKEY(), OSSL_STORE_INFO_new_CERT() and -OSSL_STORE_INFO_new_CRL() create a B<OSSL_STORE_INFO> -object to hold the given input object. +, OSSL_STORE_INFO_new_PUBKEY(), OSSL_STORE_INFO_new_PKEY(), +OSSL_STORE_INFO_new_CERT() and OSSL_STORE_INFO_new_CRL() +create a B<OSSL_STORE_INFO> object to hold the given input object. On success the input object is consumed. Additionally, for B<OSSL_STORE_INFO_NAME>` objects, |