PKCS12_pbe_crypt

Encrypt or decrypt a buffer using a PKCS#12 PBE algorithm.

Synopsis

Declared in <openssl/pkcs12.h>

unsigned char*
PKCS12_pbe_crypt(
    X509_ALGOR const* algor,
    char const* pass,
    int passlen,
    unsigned char const* in,
    int inlen,
    unsigned char** data,
    int* datalen,
    int en_de);

Return Value

Pointer to output buffer (same as *data), or NULL on error.

Parameters

NameDescription
algorPBE algorithm identifier.
passPassphrase.
passlenLength of pass, or -1 to use strlen().
inInput buffer.
inlenLength of in in bytes.
dataAddress of output buffer pointer (malloc'd on success).
datalenAddress to receive output length in bytes.
en_de1 to encrypt, 0 to decrypt.