PKCS8_pkey_set0

Set the algorithm, version, parameters, and encoded private key on a PKCS#8 PrivateKeyInfo.

Synopsis

Declared in <openssl/x509.h>

int
PKCS8_pkey_set0(
    PKCS8_PRIV_KEY_INFO* priv,
    ASN1_OBJECT* aobj,
    int version,
    int ptype,
    void* pval,
    unsigned char* penc,
    int penclen);

Return Value

1 on success, or 0 on failure.

Parameters

NameDescription
privPKCS#8 structure to update.
aobjAlgorithm OID to assign (ownership transferred as implemented).
versionPKCS#8 version field value.
ptypeASN.1 type of pval (V_ASN1_*).
pvalAlgorithm parameters value matching ptype, or NULL.
pencEncoded private-key octets; ownership transferred on success.
penclenLength of penc in bytes.