D2I_ASN1_NULL(3)
π NAME π
okay so this is the D2I_ASN1_NULL(3) manual page, bestie β the manual name is right there, no cap. π
d2i_ASN1_NULL,i2d_ASN1_NULLβ decode and encode an ASN.1 NULL type
β¨ SYNOPSIS β¨
library βlibcryptoβ #include <openssl/asn1.h>
ASN1_NULL *
d2i_ASN1_NULL(ASN1_NULL **val_out, const unsigned char **der_in,
long length);
int
i2d_ASN1_NULL(ASN1_NULL *val_in, unsigned char **der_out);
π¦ DESCRIPTION π¦
Basically, these two are the decode/encode duo for the ASN.1 value NULL of type NULL. For the full tea on semantics, examples, caveats, and bugs, go see ASN1_item_d2i(3).
d2i_ASN1_NULL() checks that the BER-encoded value at *der_in is NULL and is of type NULL. It fails if length is less than 2, or if the first two bytes of *der_in differ from 0x05 and 0x00. On success, *der_in is advanced by two bytes and *val_out is set to a specific invalid pointer representing the unique ASN1_NULL object. (yes, a specific invalid pointer β that's the whole vibe π)
i2d_ASN1_NULL() ignores val_in and encodes the ASN.1 value NULL of type NULL using DER. Specifically, it writes the identifier octet for the type NULL, 0x05, followed by the length octet 0x00, and no content or end-of-content octets. Lowkey tiny encoding, highkey perfect. β¨
π RETURN VALUES π
d2i_ASN1_NULL()β returns a specific invalid pointer representing the uniqueASN1_NULLobject, orNULLif an error occurs.i2d_ASN1_NULL()β returns2if successful, or0if an error occurs.
π₯ SEE ALSO π₯
π STANDARDS π
ITU-T Recommendation X.690, also known as ISO/IEC 8825-1: Information technology - ASN.1 encoding rules: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER), section 8.8: Encoding of a null value
π HISTORY π
d2i_ASN1_NULL() and i2d_ASN1_NULL() first appeared in OpenSSL 0.9.5 and have been available since OpenBSD 2.7. Historical slay. π«Ά
Signed off with the footer energy: Debian, June 8, 2025 β and yes, this is the D2I_ASN1_NULL(3) page. byeee π
π¦ where this page comes from
- alpine 3.24: libressl-doc 4.3.1-r0 Β· custom
- arch rolling: libressl 4.4.0-1 Β· ISC AND custom:OpenSSL
- Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms