libressl-PKCS8_PRIV_KEY_INFO_new(3)

libressl-PKCS8_PRIV_KEY_INFO_new3

Pkcs#8 private key information

Usage

Crypto Library (libcrypto, -lcrypto)

#include <openssl/x509.h>

PKCS8_PRIV_KEY_INFO *

PKCS8_PRIV_KEY_INFO_new(void);

void

PKCS8_PRIV_KEY_INFO_free(PKCS8_PRIV_KEY_INFO *key);

Overview

PKCS8_PRIV_KEY_INFO_new() allocates and initializes an empty PKCS8_PRIV_KEY_INFO object, representing an ASN.1 PrivateKeyInfo structure defined in RFC 5208 section 5. It can hold a private key together with information about the algorithm to be used with it and optional attributes.

PKCS8_PRIV_KEY_INFO_free() frees key.

Return values

PKCS8_PRIV_KEY_INFO_new() returns the new PKCS8_PRIV_KEY_INFO object or NULL if an error occurs.

Standards

RFC 5208: PKCS#8: Private-Key Information Syntax Specification

History

PKCS8_PRIV_KEY_INFO_new() and PKCS8_PRIV_KEY_INFO_free() first appeared in OpenSSL 0.9.3 and have been available since OpenBSD 2.6.

From libressl 4.4.0-1 in Arch Linux 2026-11-01. Parsed by carta from the page's mdoc source.