PKCS12_ITEM_DECRYPT_D2I(3SSL)
π PKCS12_ITEM_DECRYPT_D2I π
okay so bestie, welcome to the PKCS12_ITEM_DECRYPT_D2I(3SSL) page π this is the OpenSSL manual for the PKCS12 item encrypt/decrypt functions, and no cap, it's lowkey adorable how short it is. let's get into it β¨
β¨ NAME β¨
PKCS12_item_decrypt_d2i, PKCS12_item_decrypt_d2i_ex, PKCS12_item_i2d_encrypt, PKCS12_item_i2d_encrypt_ex β PKCS12 item encrypt/decrypt functions π¦
πΈ SYNOPSIS πΈ
#include <openssl/pkcs12.h>
void *PKCS12_item_decrypt_d2i(const X509_ALGOR *algor, const ASN1_ITEM *it,
const char *pass, int passlen,
const ASN1_OCTET_STRING *oct, int zbuf);
void *PKCS12_item_decrypt_d2i_ex(const X509_ALGOR *algor, const ASN1_ITEM *it,
const char *pass, int passlen,
const ASN1_OCTET_STRING *oct, int zbuf,
OSSL_LIB_CTX *libctx,
const char *propq);
ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt(X509_ALGOR *algor,
const ASN1_ITEM *it,
const char *pass, int passlen,
void *obj, int zbuf);
ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt_ex(X509_ALGOR *algor,
const ASN1_ITEM *it,
const char *pass, int passlen,
void *obj, int zbuf,
OSSL_LIB_CTX *ctx,
const char *propq);
π§ DESCRIPTION π§
PKCS12_item_decrypt_d2i() and PKCS12_item_decrypt_d2i_ex() decrypt an octet string that's holding an ASN.1 encoded object π
they do it using the algorithm algor and password pass with length passlen. and if zbuf is nonzero?? the output buffer gets zeroed after the decrypt, periodt π§Ό
PKCS12_item_i2d_encrypt() and PKCS12_item_i2d_encrypt_ex() go the other way β they encrypt an ASN.1 object it using the algorithm algor and password pass of length passlen, and they return an encoded object in obj π and again, if zbuf is nonzero, the buffer holding the input encoding gets zeroed after the encrypt. clean up after yourself, bestie π§½β¨
also!! the functions ending in _ex() let you use a library context ctx and a property query propq to pick which algorithm implementations get used β it's giving choose-your-own-adventure but for crypto providers π
π RETURN VALUES π
PKCS12_item_decrypt_d2i() and PKCS12_item_decrypt_d2i_ex() hand you back the decrypted object, or NULL if something went wrong π
PKCS12_item_i2d_encrypt() and PKCS12_item_i2d_encrypt_ex() return the encrypted data as an ASN.1 Octet String, or NULL if an error occurred π
π₯ SEE ALSO π₯
PKCS12_pbe_crypt_ex(3), PKCS8_encrypt_ex(3) β go read these next, iykyk π
π HISTORY π
PKCS12_item_decrypt_d2i_ex() and PKCS12_item_i2d_encrypt_ex() were added in OpenSSL 3.0 β so if you're on something older, sorry bestie, those ones aren't invited to the party π
π COPYRIGHT π
Copyright 2021 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
and that's the whole page, angel π this was OpenSSL 4.0.3, dated 2026-09-29, and you were reading the PKCS12_ITEM_DECRYPT_D2I(3SSL) manual. slay, go encrypt something responsibly π«Άπ
β¨
π¦ where this page comes from
- ubuntu stonking: libssl-doc 4.0.3-1ubuntu1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms