gnutls_pkcs7_import(3)
π gnutls_pkcs7_import π
okay bestie, welcome to the gnutls manual β yes, that whole big cryptography library β and today's episode is all about gnutls_pkcs7_import, an API function that literally just takes your PKCS7 blob and makes it β¨nativeβ¨. no cap.
πΈ SYNOPSIS πΈ
#include <gnutls/pkcs7.h>
int gnutls_pkcs7_import(gnutls_pkcs7_t pkcs7, const gnutls_datum_t *
data, gnutls_x509_crt_fmt_t format);
π ARGUMENTS π
gnutls_pkcs7_t pkcs7β bestie this is where the parsed PKCS7 goes. it's the spot, the container, the little home for your data. πconst gnutls_datum_t * dataβ the DER or PEM encoded PKCS7 itself. the actual goods. π¦gnutls_x509_crt_fmt_t formatβ one of DER or PEM. pick your fighter. π
π¦ DESCRIPTION π¦
so here's the vibe: this function converts the DER or PEM encoded PKCS7 you hand it into the native gnutls_pkcs7_t format. the output lands in pkcs7. simple, iconic, done.
β οΈ okay this part matters, listen up: any signed data that may be present inside thepkcs7structure β like certificates you set withgnutls_pkcs7_set_crt()β will be freed and overwritten by this function. like, gone gone. not me warning you twice. π
and if your PKCS7 is PEM encoded? it should have a header of "PKCS7". that's the rule, no exceptions. β¨
β RETURNS β
on success, GNUTLS_E_SUCCESS (0) is returned. otherwise you get a negative error value, which is giving "something went wrong and it's telling you in the negative numbers" energy. π
π REPORTING BUGS π
found a bug? don't be shy, report it to <bugs@gnutls.org>.
home page is right here: 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. (yes that's the whole thing, it's very generous, we love that for them π«Ά)
π§ 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, bestie!! this was gnutls version 3.8.13, page gnutls_pkcs7_import(3) β go forth and import your PKCS7 responsibly πβ¨
π¦ 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