diff options
author | Jon Spillett <jon.spillett@oracle.com> | 2021-03-15 14:26:09 +1000 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2021-06-01 12:16:27 +0200 |
commit | 169eca602c67f37abf0a44e1605998d5e7f04fa6 (patch) | |
tree | 221d3097ca04a1549d0cb93442c1c2d00f954928 /doc | |
parent | 8ee66a092c07e618191ef49c8912f8235b08bb95 (diff) |
Enhance the encoder/decoder tests to allow testing with a non-default library context and configurable providers
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14587)
Diffstat (limited to 'doc')
-rw-r--r-- | doc/build.info | 6 | ||||
-rw-r--r-- | doc/man3/b2i_PVK_bio_ex.pod | 69 |
2 files changed, 75 insertions, 0 deletions
diff --git a/doc/build.info b/doc/build.info index b77c04d2b6..42c1804d6c 100644 --- a/doc/build.info +++ b/doc/build.info @@ -2779,6 +2779,10 @@ DEPEND[html/man3/X509v3_get_ext_by_NID.html]=man3/X509v3_get_ext_by_NID.pod GENERATE[html/man3/X509v3_get_ext_by_NID.html]=man3/X509v3_get_ext_by_NID.pod DEPEND[man/man3/X509v3_get_ext_by_NID.3]=man3/X509v3_get_ext_by_NID.pod GENERATE[man/man3/X509v3_get_ext_by_NID.3]=man3/X509v3_get_ext_by_NID.pod +DEPEND[html/man3/b2i_PVK_bio_ex.html]=man3/b2i_PVK_bio_ex.pod +GENERATE[html/man3/b2i_PVK_bio_ex.html]=man3/b2i_PVK_bio_ex.pod +DEPEND[man/man3/b2i_PVK_bio_ex.3]=man3/b2i_PVK_bio_ex.pod +GENERATE[man/man3/b2i_PVK_bio_ex.3]=man3/b2i_PVK_bio_ex.pod DEPEND[html/man3/d2i_PKCS8PrivateKey_bio.html]=man3/d2i_PKCS8PrivateKey_bio.pod GENERATE[html/man3/d2i_PKCS8PrivateKey_bio.html]=man3/d2i_PKCS8PrivateKey_bio.pod DEPEND[man/man3/d2i_PKCS8PrivateKey_bio.3]=man3/d2i_PKCS8PrivateKey_bio.pod @@ -3398,6 +3402,7 @@ html/man3/X509_sign.html \ html/man3/X509_verify.html \ html/man3/X509_verify_cert.html \ html/man3/X509v3_get_ext_by_NID.html \ +html/man3/b2i_PVK_bio_ex.html \ html/man3/d2i_PKCS8PrivateKey_bio.html \ html/man3/d2i_PrivateKey.html \ html/man3/d2i_RSAPrivateKey.html \ @@ -3986,6 +3991,7 @@ man/man3/X509_sign.3 \ man/man3/X509_verify.3 \ man/man3/X509_verify_cert.3 \ man/man3/X509v3_get_ext_by_NID.3 \ +man/man3/b2i_PVK_bio_ex.3 \ man/man3/d2i_PKCS8PrivateKey_bio.3 \ man/man3/d2i_PrivateKey.3 \ man/man3/d2i_RSAPrivateKey.3 \ diff --git a/doc/man3/b2i_PVK_bio_ex.pod b/doc/man3/b2i_PVK_bio_ex.pod new file mode 100644 index 0000000000..bd670b2614 --- /dev/null +++ b/doc/man3/b2i_PVK_bio_ex.pod @@ -0,0 +1,69 @@ +=pod + +=head1 NAME + +b2i_PVK_bio, b2i_PVK_bio_ex, i2b_PVK_bio, i2b_PVK_bio_ex - Decode and encode +functions for reading and writing MSBLOB format private keys + +=head1 SYNOPSIS + + #include <openssl/pem.h> + + EVP_PKEY *b2i_PVK_bio(BIO *in, pem_password_cb *cb, void *u); + EVP_PKEY *b2i_PVK_bio_ex(BIO *in, pem_password_cb *cb, void *u, + OSSL_LIB_CTX *libctx, const char *propq); + int i2b_PVK_bio(BIO *out, const EVP_PKEY *pk, int enclevel, + pem_password_cb *cb, void *u); + int i2b_PVK_bio_ex(BIO *out, const EVP_PKEY *pk, int enclevel, + pem_password_cb *cb, void *u, + OSSL_LIB_CTX *libctx, const char *propq); + +=head1 DESCRIPTION + +b2i_PVK_bio_ex() decodes a private key of MSBLOB format read from a B<BIO>. It +attempts to automatically determine the key type. If the key is encrypted then +I<cb> is called with the user data I<u> in order to obtain a password to decrypt +the key. The supplied library context I<libctx> and property query +string I<propq> are used in any decrypt operation. + +b2i_PVK_bio() does the same as b2i_PVK_bio_ex() except that the default +library context and property query string are used. + +i2b_PVK_bio_ex() encodes I<pk> using MSBLOB format. If I<enclevel> is 1 then +a password obtained via I<pem_password_cb> is used to encrypt the private key. +If I<enclevel> is 0 then no encryption is applied. The user data in I<u> is +passed to the password callback. The supplied library context I<libctx> and +property query string I<propq> are used in any decrypt operation. + +i2b_PVK_bio() does the same as i2b_PVK_bio_ex() except that the default +library context and property query string are used. + +=head1 RETURN VALUES + +The b2i_PVK_bio() and b2i_PVK_bio_ex() functions return a valid B<EVP_KEY> +structure or B<NULL> if an error occurs. The error code can be obtained by calling +L<ERR_get_error(3)>. + +i2b_PVK_bio() and i2b_PVK_bio_ex() return the number of bytes successfully +encoded or a negative value if an error occurs. The error code can be obtained +by calling L<ERR_get_error(3)>. + +=head1 SEE ALSO + +L<crypto(7)>, +L<d2i_PKCS8PrivateKey_bio(3)> + +=head1 HISTORY + +b2i_PVK_bio_ex() and i2b_PVK_bio_ex() were added in OpenSSL 3.0. + +=head1 COPYRIGHT + +Copyright 2021 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the Apache License 2.0 (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +L<https://www.openssl.org/source/license.html>. + +=cut |