Home | History | Annotate | Line # | Download | only in man3
      1 =pod
      2 
      3 =head1 NAME
      4 
      5 EVP_PKEY2PKCS8, EVP_PKCS82PKEY_ex, EVP_PKCS82PKEY
      6 - Convert a private key to/from PKCS8
      7 
      8 =head1 SYNOPSIS
      9 
     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 
     17 =head1 DESCRIPTION
     18 
     19 EVP_PKEY2PKCS8() converts a private key I<pkey> into a returned PKCS8 object.
     20 
     21 EVP_PKCS82PKEY_ex() converts a PKCS8 object I<p8> into a returned private key.
     22 It uses I<libctx> and I<propq> when fetching algorithms.
     23 
     24 EVP_PKCS82PKEY() is similar to EVP_PKCS82PKEY_ex() but uses default values of
     25 NULL for the I<libctx> and I<propq>.
     26 
     27 =head1 RETURN VALUES
     28 
     29 EVP_PKEY2PKCS8() returns a PKCS8 object on success.
     30 EVP_PKCS82PKEY() and EVP_PKCS82PKEY_ex() return a private key on success.
     31 
     32 All functions return NULL if the operation fails.
     33 
     34 =head1 SEE ALSO
     35 
     36 L<PKCS8_pkey_add1_attr(3)>,
     37 
     38 =head1 COPYRIGHT
     39 
     40 Copyright 2020-2023 The OpenSSL Project Authors. All Rights Reserved.
     41 
     42 Licensed under the Apache License 2.0 (the "License").  You may not use
     43 this file except in compliance with the License.  You can obtain a copy
     44 in the file LICENSE in the source distribution or at
     45 L<https://www.openssl.org/source/license.html>.
     46 
     47 =cut
     48