summaryrefslogtreecommitdiffstats
path: root/doc/man3
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2021-04-08 20:05:14 +1000
committerTomas Mraz <tomas@openssl.org>2021-04-15 18:42:04 +0200
commita732a4c329144f0b4c60372d9b7106c6b88ddd9f (patch)
treef5dd1f0e6d8ebfb89a3ec536b94a8b1297148d6a /doc/man3
parenta56fcf20da9e2bbc73aa3cf503204bdb44cb023f (diff)
Add EVP_PKEY_todata() and EVP_PKEY_export() functions.
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14800)
Diffstat (limited to 'doc/man3')
-rw-r--r--doc/man3/EVP_PKEY_fromdata.pod3
-rw-r--r--doc/man3/EVP_PKEY_todata.pod64
2 files changed, 66 insertions, 1 deletions
diff --git a/doc/man3/EVP_PKEY_fromdata.pod b/doc/man3/EVP_PKEY_fromdata.pod
index 1c85474662..d24fb34a25 100644
--- a/doc/man3/EVP_PKEY_fromdata.pod
+++ b/doc/man3/EVP_PKEY_fromdata.pod
@@ -78,6 +78,7 @@ public key and key parameters.
=head1 NOTES
These functions only work with key management methods coming from a provider.
+This is the mirror function to L<EVP_PKEY_todata(3)>.
=for comment We may choose to make this available for legacy methods too...
@@ -259,7 +260,7 @@ example with L<OSSL_PARAM_allocate_from_text(3)>.
=head1 SEE ALSO
L<EVP_PKEY_CTX_new(3)>, L<provider(7)>, L<EVP_PKEY_gettable_params(3)>,
-L<OSSL_PARAM(3)>,
+L<OSSL_PARAM(3)>, L<EVP_PKEY_todata(3)>,
L<EVP_PKEY-RSA(7)>, L<EVP_PKEY-DSA(7)>, L<EVP_PKEY-DH(7)>, L<EVP_PKEY-EC(7)>,
L<EVP_PKEY-ED448(7)>, L<EVP_PKEY-X25519(7)>, L<EVP_PKEY-X448(7)>,
L<EVP_PKEY-ED25519(7)>
diff --git a/doc/man3/EVP_PKEY_todata.pod b/doc/man3/EVP_PKEY_todata.pod
new file mode 100644
index 0000000000..98ae484755
--- /dev/null
+++ b/doc/man3/EVP_PKEY_todata.pod
@@ -0,0 +1,64 @@
+=pod
+
+=head1 NAME
+
+EVP_PKEY_todata, EVP_PKEY_export
+- functions to return keys as an array of key parameters
+
+=head1 SYNOPSIS
+
+ #include <openssl/evp.h>
+
+ int EVP_PKEY_todata(const EVP_PKEY *pkey, int selection, OSSL_PARAM **params);
+ int EVP_PKEY_export(const EVP_PKEY *pkey, int selection,
+ OSSL_CALLBACK *export_cb, void *export_cbarg);
+
+=head1 DESCRIPTION
+
+The functions described here are used to extract B<EVP_PKEY> key values as an
+array of B<OSSL_PARAM>.
+
+EVP_PKEY_todata() extracts values from a key I<pkey> using the I<selection>.
+I<selection> is described in L<EVP_PKEY_fromdata(3)/Selections>.
+L<OSSL_PARAM_free(3)> should be used to free the returned parameters in
+I<*params>.
+
+EVP_PKEY_export() is similiar to EVP_PKEY_todata() but uses a callback
+I<export_cb> that gets passed the value of I<export_cbarg>.
+See L<openssl-core.h(7)> for more information about the callback. Note that the
+B<OSSL_PARAM> array that is passed to the callback is not persistent after the
+callback returns. The user must preserve the items of interest, or use
+EVP_PKEY_todata() if persistence is required.
+
+=head1 NOTES
+
+These functions only work with key management methods coming from a provider.
+This is the mirror function to L<EVP_PKEY_fromdata(3)>.
+
+=head1 RETURN VALUES
+
+EVP_PKEY_todata() and EVP_PKEY_export() return 1 for success and 0 for failure.
+
+=head1 SEE ALSO
+
+L<OSSL_PARAM(3)>, L<openssl-core.h(7)>,
+L<EVP_PKEY_fromdata(3)>,
+L<EVP_PKEY-RSA(7)>, L<EVP_PKEY-DSA(7)>, L<EVP_PKEY-DH(7)>, L<EVP_PKEY-EC(7)>,
+L<EVP_PKEY-ED448(7)>, L<EVP_PKEY-X25519(7)>, L<EVP_PKEY-X448(7)>,
+L<EVP_PKEY-ED25519(7)>
+
+=head1 HISTORY
+
+These functions 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
+