D2I_PKEY_USAGE_PERIOD(3)

πŸ“¦ version 4.4.0, in alpine 3.24, arch rolling

✨ D2I_PKEY_USAGE_PERIOD(3) ✨

okay so bestie, this is a page from the Library Functions Manual and it's all about the d2i_PKEY_USAGE_PERIOD and i2d_PKEY_USAGE_PERIOD girlies β€” the decode/encode duo for X.509 key usage period extensions πŸ’…


🌸 NAME 🌸

d2i_PKEY_USAGE_PERIOD, i2d_PKEY_USAGE_PERIOD β€” decode and encode X.509 key usage period extensions πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

like, first you gotta bring in the library β€” it's libcrypto:

#include <openssl/x509v3.h>

then the decoding icon herself:

PKEY_USAGE_PERIOD *
d2i_PKEY_USAGE_PERIOD(PKEY_USAGE_PERIOD **val_out,
    const unsigned char **der_in, long length);

and her encoding bestie:

int
i2d_PKEY_USAGE_PERIOD(PKEY_USAGE_PERIOD *val_in,
    unsigned char **der_out);

πŸ’– DESCRIPTION πŸ’–

so d2i_PKEY_USAGE_PERIOD() and i2d_PKEY_USAGE_PERIOD() decode and encode an ASN.1 PrivateKeyUsagePeriod structure β€” and this structure is literally defined in RFC 3280 section 4.2.1.4, no cap πŸ“œ

ngl, if you want the details about the semantics, examples, caveats, and bugs, the page is like "go read ASN1_item_d2i(3)" β€” that's where all the lore lives ✨


πŸ”₯ RETURN VALUES πŸ”₯

  • d2i_PKEY_USAGE_PERIOD() β€” returns a PKEY_USAGE_PERIOD object, or NULL if an error occurs 😭
  • i2d_PKEY_USAGE_PERIOD() β€” returns the number of bytes successfully encoded, or a negative value if an error occurs πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘

go give them a read, iykyk 🫢


🌈 STANDARDS 🌈


⭐ HISTORY ⭐

d2i_PKEY_USAGE_PERIOD() and i2d_PKEY_USAGE_PERIOD() first appeared in OpenSSL 0.9.2b and have been available since OpenBSD 2.6 β€” vintage icons fr fr 🧚


okay that's the whole page bestie, you ate that πŸ’… this cutie was served up by Debian on June 8, 2025 β€” go forth and decode responsibly, mwah πŸŽ€βœ¨

πŸ“¦ where this page comes from