1EVP_PKEY2PKCS8(3ossl)               OpenSSL              EVP_PKEY2PKCS8(3ossl)
2
3
4

NAME

6       EVP_PKEY2PKCS8, EVP_PKCS82PKEY_ex, EVP_PKCS82PKEY - Convert a private
7       key to/from PKCS8
8

SYNOPSIS

10        #include <openssl/x509.h>
11
12        PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(const EVP_PKEY *pkey);
13        EVP_PKEY *EVP_PKCS82PKEY(const PKCS8_PRIV_KEY_INFO *p8);
14        EVP_PKEY *EVP_PKCS82PKEY_ex(const PKCS8_PRIV_KEY_INFO *p8, OSSL_LIB_CTX *libctx,
15                                    const char *propq);
16

DESCRIPTION

18       EVP_PKEY2PKCS8() converts a private key pkey into a returned PKCS8
19       object.
20
21       EVP_PKCS82PKEY_ex() converts a PKCS8 object p8 into a returned private
22       key.  It uses libctx and propq when fetching algorithms.
23
24       EVP_PKCS82PKEY() is similiar to EVP_PKCS82PKEY_ex() but uses default
25       values of NULL for the libctx and propq.
26

RETURN VALUES

28       EVP_PKEY2PKCS8() returns a PKCS8 object on success.  EVP_PKCS82PKEY()
29       and EVP_PKCS82PKEY_ex() return a private key on success.
30
31       All functions return NULL if the operation fails.
32

SEE ALSO

34       PKCS8_pkey_add1_attr(3),
35
37       Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
38
39       Licensed under the Apache License 2.0 (the "License").  You may not use
40       this file except in compliance with the License.  You can obtain a copy
41       in the file LICENSE in the source distribution or at
42       <https://www.openssl.org/source/license.html>.
43
44
45
463.0.5                             2022-11-01             EVP_PKEY2PKCS8(3ossl)
Impressum