PKEY_USAGE_PERIOD_NEW(3)

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

πŸ’– PKEY_USAGE_PERIOD_NEW(3) πŸ’–

okay so bestie, welcome to the libcrypto manual page for the private key usage period extension ✨ this one's short and sweet, no cap.


🌸 NAME 🌸

PKEY_USAGE_PERIOD_new, PKEY_USAGE_PERIOD_free β€” the X.509 certificate private key usage period extension, bestie πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

library "libcrypto"

#include <openssl/x509v3.h>

PKEY_USAGE_PERIOD *
PKEY_USAGE_PERIOD_new(void);

void
PKEY_USAGE_PERIOD_free(PKEY_USAGE_PERIOD *period);

πŸ’… DESCRIPTION πŸ’…

So PKEY_USAGE_PERIOD_new() allocates and initializes an empty PKEY_USAGE_PERIOD object β€” and like, what even is that? It's representing an ASN.1 PrivateKeyUsagePeriod structure, which is defined in RFC 3280 section 4.2.1.4. iconic behavior fr fr πŸ’œ

You could use it in X509 certificates to specify a validity period for the private key that differed from the validity period of the certificate. literally the whole point πŸ’«

Then PKEY_USAGE_PERIOD_free() frees period. clean up after yourself bestie, that's the vibe 🌈


🫢 RETURN VALUES 🫢

PKEY_USAGE_PERIOD_new() returns the new PKEY_USAGE_PERIOD object, or NULL if an error occurs. she's either giving or she's giving nothing 😭

heads up: if you get NULL, something went wrong β€” don't go dereferencing it, please, I'm begging πŸ™ˆ

πŸ‘‘ SEE ALSO πŸ‘‘

go read those too, iykyk πŸ”₯


⭐ STANDARDS ⭐

RFC 3280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile, section 4.2.1.4: Private Key Usage Period ✨

and okay, plot twist 😭 β€” RFC 3280 was obsoleted by RFC 5280, which says:

"Section 4.2.1.4 in RFC 3280, which specified the PrivateKeyUsagePeriod certificate extension but deprecated its use, was removed. Use of this ISO standard extension is neither deprecated nor recommended for use in the Internet PKI."

so like… the extension got removed from the newer spec πŸ’€ and the newer spec says using it is neither deprecated nor recommended. that's the whole tea, bestie πŸ“


🧚 HISTORY 🧚

PKEY_USAGE_PERIOD_new() and PKEY_USAGE_PERIOD_free() first appeared in OpenSSL 0.9.2b and have been available since OpenBSD 2.6. vintage queens πŸ‘‘


that's a wrap babes πŸ’– this page is from Debian, dated June 8, 2025, and it's PKEY_USAGE_PERIOD_NEW(3) β€” slay, go forth and manage your periods 🩷✨

πŸ“¦ where this page comes from