Create an encrypted pkcs8ShroudedKeyBag safeBag from PKCS#8 private key info.

Synopsis

Declared in <openssl/pkcs12.h>

PKCS12_SAFEBAG*
PKCS12_SAFEBAG_create_pkcs8_encrypt_ex(
    int pbe_nid,
    char const* pass,
    int passlen,
    unsigned char* salt,
    int saltlen,
    int iter,
    PKCS8_PRIV_KEY_INFO* p8inf,
    OSSL_LIB_CTX* ctx,
    char const* propq);

Return Value

New safeBag, or NULL on error.

Parameters

Name

Description

pbe_nid

PBE algorithm NID, or 0 for a default.

pass

Passphrase for encryption.

passlen

Length of pass, or ‐1 to use strlen().

salt

Salt for key derivation, or NULL to generate one.

saltlen

Length of salt in bytes.

iter

Iteration count, or 0 for the default (2048).

p8inf

Private key info to encrypt.

ctx

Library context for algorithm fetching, or NULL for default.

propq

Property query for algorithm fetching, or NULL.

Created with MrDocs