X509_REQ_NEW(3)
π NAME π
Okay bestie, welcome to the X509_REQ_NEW(3) page from the Library Functions Manual β manual name folded in right here, no boring header line, periodt π
This whole page is about PKCS#10 certification requests, and the main-character function squad is:
X509_REQ_newX509_REQ_dupX509_to_X509_REQX509_REQ_freeX509_REQ_INFO_newX509_REQ_INFO_free
πΈ SYNOPSIS πΈ
No cap, hereβs the exact code vibe:
#include <openssl/x509.h>
X509_REQ *
X509_REQ_new(void);
X509_REQ *
X509_REQ_dup(X509_REQ *req);
X509_REQ *
X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md);
void
X509_REQ_free(X509_REQ *req);
X509_REQ_INFO *
X509_REQ_INFO_new(void);
void
X509_REQ_INFO_free(X509_REQ_INFO *req_info);
β¨ DESCRIPTION β¨
Okay so hereβs the tea, function by function β Stay with me, itβs actually so good.
X509_REQ_new()β allocates and initializes an emptyX509_REQobject, representing an ASN.1CertificationRequeststructure defined in RFC 2986 section 4.2. It can hold a pointer to anX509_REQ_INFOobject discussed below together with a cryptographic signature and information about the signature algorithm used. Fresh empty request object energy, fr fr β¨X509_REQ_dup()β creates a deep copy ofrequsingASN1_item_dup(3), setting the reference count of the copy to1. Deep copy, reference count1, no sharing drama πX509_to_X509_REQ()β allocates a new certification request object, copies the subject name and the public key into it from the certificatex, and sets the version to zero. UnlesspkeyisNULL, it also signs the request withX509_REQ_sign(3)usingpkeyandmd. Itβs giving βturn my cert into a request,β and it signs when you hand it apkeyπX509_REQ_free()β freesreq. Ifreqis aNULLpointer, no action occurs. Free it and move on;NULLgets a little shrug, no action π«ΆX509_REQ_INFO_new()β allocates and initializes an emptyX509_REQ_INFOobject, representing an ASN.1CertificationRequestInfostructure defined in RFC 2986 section 4.1. It is used inside theX509_REQobject and can hold the subject and the public key of the requested certificate and additional attributes. This is the inner info baddie that lives insideX509_REQπX509_REQ_INFO_free()β freesreq_info. Ifreq_infois aNULLpointer, no action occurs. SameNULL-safe free energy: no action, no problem π¦
π«Ά RETURN VALUES π«Ά
Okay, the return-value vibe check: X509_REQ_new(), X509_REQ_dup(), X509_to_X509_REQ(), and X509_REQ_INFO_new() return the new X509_REQ or X509_REQ_INFO object, respectively, or NULL if an error occurs.
So: object = slay, NULL = error π
π SEE ALSO π
Your required-reading group chat, all exact:
d2i_X509_REQ(3)PEM_read_X509_REQ(3)X509_new(3)X509_REQ_add1_attr(3)X509_REQ_add_extensions(3)X509_REQ_check_private_key(3)X509_REQ_digest(3)X509_REQ_get0_signature(3)X509_REQ_get_pubkey(3)X509_REQ_get_subject_name(3)X509_REQ_get_version(3)X509_REQ_print_ex(3)X509_REQ_sign(3)
π STANDARDS π
The standard repping this page: RFC 2986: PKCS #10: Certification Request Syntax Specification.
π¦ HISTORY π¦
Ancient lore time, bestie:
X509_REQ_new(), X509_REQ_free(), X509_REQ_INFO_new(), and X509_REQ_INFO_free() first appeared in SSLeay 0.4.4, X509_REQ_dup() in SSLeay 0.5.1, and X509_to_X509_REQ() in SSLeay 0.6.0. These functions have been available since OpenBSD 2.4.
Yes, that old. Yes, still iconic. Periodt π
And thatβs the whole page, bestie π
This one is brought to you by Debian, dated October 29, 2021, and filed under X509_REQ_NEW(3) β mwah π
π¦ where this page comes from
- opensuse-leap 16.0: libressl-devel-doc 4.1.0-bp160.1.1 Β· OpenSSL
- Copyright (c) 2016, 2021 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