X509_SIGN(3)
πΈ NAME πΈ
okay so bestie, welcome to X509_SIGN(3) from the Library Functions Manual β this is the libcrypto page for signing and verifying certificate, certificate request, or CRL signatures. The whole squad is:
X509_signX509_sign_ctxX509_verifyX509_REQ_signX509_REQ_sign_ctxX509_REQ_verifyX509_CRL_signX509_CRL_sign_ctxX509_CRL_verify
β sign or verify certificate, certificate request, or CRL signature π
β¨ SYNOPSIS β¨
exact lineup, no edits, iykyk:
library βlibcryptoβ #include <openssl/x509.h>
int
X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md);
int
X509_sign_ctx(X509 *x, EVP_MD_CTX *ctx);
int
X509_verify(X509 *x, EVP_PKEY *pkey);
int
X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md);
int
X509_REQ_sign_ctx(X509_REQ *x, EVP_MD_CTX *ctx);
int
X509_REQ_verify(X509_REQ *x, EVP_PKEY *pkey);
int
X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md);
int
X509_CRL_sign_ctx(X509_CRL *x, EVP_MD_CTX *ctx);
int
X509_CRL_verify(X509_CRL *x, EVP_PKEY *pkey);
π¦ DESCRIPTION π¦
X509_sign()β signs the certificatexusing the private keypkeyand the message digestmd, and sets the signature inx. slay.X509_sign_ctx()β also signs the certificatex, but uses the parameters contained in digest contextctx.X509_verify()β verifies the signature of certificatexusing the public keypkey. Be so for real: only the signature is checked; no other checks (such as certificate chain validity) are performed.X509_REQ_sign(),X509_REQ_sign_ctx(),X509_REQ_verify(),X509_CRL_sign(),X509_CRL_sign_ctx(), andX509_CRL_verify()β sign and verify certificate requests and CRLs, respectively. iconic.X509_sign_ctx()β used where the default parameters for the corresponding public key and digest are not suitable. It can be used to sign keys using RSA-PSS for example. that's the special-case queen.
π RETURN VALUES π
X509_sign(),X509_sign_ctx(),X509_REQ_sign(),X509_REQ_sign_ctx(),X509_CRL_sign(), andX509_CRL_sign_ctx()β return the size of the signature in bytes for success or0for failure. periodt.X509_verify(),X509_REQ_verify(), andX509_CRL_verify()β return1if the signature is valid or0if the signature check fails. If the signature could not be checked at all because it was invalid or some other error occurred, then-1is returned. π- In some cases of failure, the reason can be determined with
ERR_get_error(3).
π₯ SEE ALSO π₯
go read these next, bestie:
d2i_X509(3)EVP_DigestInit(3)X509_CRL_get0_by_serial(3)X509_CRL_new(3)X509_get_pubkey(3)X509_get_subject_name(3)X509_get_version(3)X509_NAME_add_entry_by_txt(3)X509_NAME_ENTRY_get_object(3)X509_NAME_get_index_by_NID(3)X509_NAME_print_ex(3)X509_new(3)X509_REQ_new(3)X509_verify_cert(3)X509V3_get_d2i(3)
π HISTORY π
X509_verify()appeared in SSLeay 0.4 or earlier.X509_sign()andX509_REQ_sign()first appeared in SSLeay 0.4.4.X509_REQ_verify()andX509_CRL_verify()first appeared in SSLeay 0.4.5b.X509_CRL_sign()first appeared in SSLeay 0.5.1.- These functions have been available since OpenBSD 2.4.
X509_sign_ctx(),X509_REQ_sign_ctx(), andX509_CRL_sign_ctx()first appeared in OpenSSL 1.0.1 and have been available since OpenBSD 5.3.
that's the whole X509_SIGN(3) tea, bestie β brought to you by Debian, July 11, 2025 πβ¨
π¦ 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) 2015, 2016 The OpenSSL Project. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms