Encrypt a PKCS#8 private key info structure (default library context).

Synopsis

Declared in <openssl/pkcs12.h>

X509_SIG*
PKCS8_encrypt(
    int pbe_nid,
    EVP_CIPHER const* cipher,
    char const* pass,
    int passlen,
    unsigned char* salt,
    int saltlen,
    int iter,
    PKCS8_PRIV_KEY_INFO* p8);

Return Value

Encrypted key in an X509_SIG, or NULL on error.

Parameters

Name

Description

pbe_nid

PBE algorithm NID.

cipher

Cipher for PBES2, or NULL when pbe_nid selects a full PBE scheme.

pass

Passphrase for encryption.

passlen

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

salt

Salt for key derivation.

saltlen

Length of salt in bytes.

iter

Iteration count for key derivation.

p8

Private key info to encrypt.

Created with MrDocs