PKCS12_ITEM_DECRYPT_D2I(3ossl)
π PKCS12_ITEM_DECRYPT_D2I π
okay bestie so this is the OpenSSL manual page for PKCS12_ITEM_DECRYPT_D2I(3ossl) β yes that's the whole vibe, section 3ossl, we're in the library-functions part of the man pages. it's giving "crypto but make it cute". let's get into it π
β¨ NAME β¨
PKCS12_item_decrypt_d2i, PKCS12_item_decrypt_d2i_ex, PKCS12_item_i2d_encrypt, PKCS12_item_i2d_encrypt_ex β the PKCS12 item encrypt/decrypt girlies. they do exactly what the name says: encrypt an item, decrypt an item, live laugh love π
πΈ 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);
like, copy that verbatim bestie, don't be doing typo edits on me π
π¦ DESCRIPTION π¦
so here's the tea β
PKCS12_item_decrypt_d2i() and PKCS12_item_decrypt_d2i_ex() decrypt an octet string that's holding an ASN.1 encoded object β they use the algorithm algor and the password pass which is passlen long. and bestie, listen: if zbuf is nonzero, then the output buffer gets zeroed after the decrypt. that's the "clean up after yourself" energy, we love to see it π
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 the password pass of length passlen, returning an encoded object in obj. and same deal: if zbuf is nonzero, the buffer containing the input encoding gets zeroed after the encrypt. scrubbing the evidence, iconic π₯
and the functions ending in _ex()? those are the glow-up versions β they let a library context ctx and a property query propq be used to pick which algorithm implementations get used. main character energy for real π
π RETURN VALUES π
PKCS12_item_decrypt_d2i()andPKCS12_item_decrypt_d2i_ex()hand you back the decrypted object. orNULLif something went wrong πPKCS12_item_i2d_encrypt()andPKCS12_item_i2d_encrypt_ex()hand you back the encrypted data as anASN1_OCTET_STRING. orNULLif something went wrong π
like, NULL is the vibe check failing. check your inputs bestie π«Ά
π SEE ALSO π
go read those next, iykyk π
β HISTORY β
PKCS12_item_decrypt_d2i_ex() and PKCS12_item_i2d_encrypt_ex() are the new girls β they were added in OpenSSL 3.0. periodt. β¨
π 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 bestie π this was 3.5.0, dated 2026-09-25 β mwah, go encrypt something responsibly ππ§ββοΈ
π¦ where this page comes from
- opensuse-leap 16.0: openssl-3-doc 3.5.0-160000.11.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms