gnutls_x509_crt_set_serial(3)
β¨ NAME β¨
gnutls_x509_crt_set_serial β bestie, it's an API function π
(from the gnutls manual, page gnutls_x509_crt_set_serial(3))
πΈ SYNOPSIS πΈ
#include <gnutls/x509.h>
int gnutls_x509_crt_set_serial(gnutls_x509_crt_t cert, const void *
serial, size_t serial_size);
π ARGUMENTS π
gnutls_x509_crt_t certβ a certificate of typegnutls_x509_crt_t. yes girl, that's the one you're about to mess with πconst void * serialβ The serial number. that's it, that's the whole vibesize_t serial_sizeβ Holds the size of the serial field. so likeβ¦ how many bytes of serial we talkin' π¦
π« DESCRIPTION π«
okay so. This function will set the X.509 certificate's serial number. iconic, I know.
Here's the tea though: while the serial number is technically an integer, it is often handled as an opaque field by several CAs. like, they just pass it around as a blob and don't think about it π. For this reason this function accepts any kind of data as a serial number. no judgment, it'll take it.
But β and this is the part where you gotta be a good citizen β to be consistent with the X.509/PKIX specifications, the provided serial should be a big-endian positive number (i.e. its leftmost bit should be zero). π«Ά
π the size of the serial is restricted to 20 bytes maximum by RFC5280. This function allows writing more than 20 bytes, but the generated certificates in that case may be rejected by other implementations. so like, you can do it, but bestieβ¦ why. π
β RETURNS β
On success, GNUTLS_E_SUCCESS (0) is returned. otherwise you get a negative error value. slay either way, but one of these is definitely the one you want π
π REPORTING BUGS π
Report bugs to <bugs@gnutls.org>. Home page: https://www.gnutls.org
π COPYRIGHT π
Copyright Β© 2001-2023 Free Software Foundation, Inc., and others.
Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.
π SEE ALSO π
The full documentation for gnutls is maintained as a Texinfo manual. If the /usr/share/doc/gnutls/ directory does not contain the HTML form, visit
https://www.gnutls.org/manual/
and that's the whole page, no cap π§ this was gnutls 3.8.13, gnutls_x509_crt_set_serial(3) β go set some serials, bestie, and keep 'em under 20 bytes for me π
π¦ where this page comes from
- alpine 3.22: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.23: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.24: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- arch rolling: gnutls 3.8.13-3 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- ubuntu stonking: gnutls-doc 3.8.13-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms