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

Synopsis

Declared in <openssl/pkcs12.h>

PKCS12_SAFEBAG*
PKCS12_SAFEBAG_create_pkcs8_encrypt(
    int pbe_nid,
    char const* pass,
    int passlen,
    unsigned char* salt,
    int saltlen,
    int iter,
    PKCS8_PRIV_KEY_INFO* p8inf);

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.

Created with MrDocs