summaryrefslogtreecommitdiffstats
path: root/doc/man3/EVP_PKEY_set1_RSA.pod
diff options
context:
space:
mode:
authorJack Lloyd <jack.lloyd@ribose.com>2018-06-18 21:49:15 +0200
committerMatt Caswell <matt@openssl.org>2018-06-19 12:29:44 +0200
commit2f2e6b6278bc4cbf670e42ae9f4ff818529df37c (patch)
tree6b7fb6ea46a74d909bf48da979ecd209b45625c7 /doc/man3/EVP_PKEY_set1_RSA.pod
parentConvert our own check of OPENSSL_NO_DEPRECATED (diff)
downloadopenssl-2f2e6b6278bc4cbf670e42ae9f4ff818529df37c.tar.xz
openssl-2f2e6b6278bc4cbf670e42ae9f4ff818529df37c.zip
Add EVP_PKEY_set_alias_type
Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6443)
Diffstat (limited to 'doc/man3/EVP_PKEY_set1_RSA.pod')
-rw-r--r--doc/man3/EVP_PKEY_set1_RSA.pod16
1 files changed, 15 insertions, 1 deletions
diff --git a/doc/man3/EVP_PKEY_set1_RSA.pod b/doc/man3/EVP_PKEY_set1_RSA.pod
index 884cf91cb7..2a1ec92268 100644
--- a/doc/man3/EVP_PKEY_set1_RSA.pod
+++ b/doc/man3/EVP_PKEY_set1_RSA.pod
@@ -7,7 +7,7 @@ EVP_PKEY_get1_RSA, EVP_PKEY_get1_DSA, EVP_PKEY_get1_DH, EVP_PKEY_get1_EC_KEY,
EVP_PKEY_get0_RSA, EVP_PKEY_get0_DSA, EVP_PKEY_get0_DH, EVP_PKEY_get0_EC_KEY,
EVP_PKEY_assign_RSA, EVP_PKEY_assign_DSA, EVP_PKEY_assign_DH,
EVP_PKEY_assign_EC_KEY, EVP_PKEY_get0_hmac, EVP_PKEY_type, EVP_PKEY_id,
-EVP_PKEY_base_id, EVP_PKEY_set1_engine - EVP_PKEY assignment functions
+EVP_PKEY_base_id, EVP_PKEY_set_alias_type, EVP_PKEY_set1_engine - EVP_PKEY assignment functions
=head1 SYNOPSIS
@@ -37,6 +37,7 @@ EVP_PKEY_base_id, EVP_PKEY_set1_engine - EVP_PKEY assignment functions
int EVP_PKEY_id(const EVP_PKEY *pkey);
int EVP_PKEY_base_id(const EVP_PKEY *pkey);
int EVP_PKEY_type(int type);
+ int EVP_PKEY_set_alias_type(EVP_PKEY *pkey, int type);
int EVP_PKEY_set1_engine(EVP_PKEY *pkey, ENGINE *engine);
@@ -78,6 +79,10 @@ must be called after the key algorithm and components are set up.
If B<engine> does not include an B<EVP_PKEY_METHOD> for B<pkey> an
error occurs.
+EVP_PKEY_set_alias_type() allows modifying a EVP_PKEY to use a
+different set of algorithms than the default. This is currently used
+to support SM2 keys, which use an identical encoding to ECDSA.
+
=head1 NOTES
In accordance with the OpenSSL naming convention the key obtained
@@ -98,6 +103,13 @@ is no longer possible: the equivalent is EVP_PKEY_base_id(pkey).
EVP_PKEY_set1_engine() is typically used by an ENGINE returning an HSM
key as part of its routine to load a private key.
+=head1 EXAMPLES
+
+After loading an ECC key, it is possible to convert it to using SM2
+algorithms with EVP_PKEY_set_alias_type:
+
+ EVP_PKEY_set_alias_type(pkey, EVP_PKEY_SM2);
+
=head1 RETURN VALUES
EVP_PKEY_set1_RSA(), EVP_PKEY_set1_DSA(), EVP_PKEY_set1_DH() and
@@ -115,6 +127,8 @@ type or B<NID_undef> (equivalently B<EVP_PKEY_NONE>) on error.
EVP_PKEY_set1_engine() returns 1 for success and 0 for failure.
+EVP_PKEY_set_alias_type() returns 1 for success and 0 for error.
+
=head1 SEE ALSO
L<EVP_PKEY_new(3)>