gnutls_pkcs7_verify(3)
๐ gnutls_pkcs7_verify(3) ๐
okay bestie, welcome to the gnutls manual, page gnutls_pkcs7_verify(3). this one is lowkey a whole vibe โ it's the API function that checks whether some data actually matches a signature sitting inside a PKCS 7 structure. let's get into it ๐
โจ NAME โจ
gnutls_pkcs7_verify โ API function ๐ซถ
โจ SYNOPSIS โจ
#include <gnutls/pkcs7.h>
int gnutls_pkcs7_verify(gnutls_pkcs7_t pkcs7, gnutls_x509_trust_list_t
tl, gnutls_typed_vdata_st * vdata, unsigned int vdata_size, unsigned
idx, const gnutls_datum_t * data, unsigned flags);
like yes, that's a lot of arguments. we'll go through every single one, no skipping, periodt ๐
โจ ARGUMENTS โจ
gnutls_pkcs7_t pkcs7โ this should contain agnutls_pkcs7_ttype. it's the PKCS 7 structure we're vibing with ๐gnutls_x509_trust_list_t tlโ a list of trusted certificates. the guest list for this party, fr fr ๐ฅgnutls_typed_vdata_st * vdataโ an array of typed data โจunsigned int vdata_sizeโ the number of data elements. how many are in that array ๐unsigned idxโ the index of the signature info to check. which one are we looking at ๐const gnutls_datum_t * dataโ the data to be verified, orNULL๐ฆunsigned flagsโ zero, or an OR list ofgnutls_certificate_verify_flags๐ธ
โจ DESCRIPTION โจ
so the way this works is: this function verifies the provided data against the signature that's present in the SignedData of the PKCS 7 structure. that's the whole main character moment ๐
and if the data you passed in is NULL? not a problem bestie โ then the data in the encapsulatedContent field gets used instead. iconic behaviour honestly ๐
โจ RETURNS โจ
on success, GNUTLS_E_SUCCESS (0) is returned ๐ otherwise you get a negative error value, and we do NOT love that for us ๐ญ
specifically:
- a verification error results in a
GNUTLS_E_PK_SIG_VERIFY_FAILED - the lack of encapsulated data to verify results in a
GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE
ngl if you see one of those negative values, something did not slay. read it, don't ignore it ๐
โจ SINCE โจ
3.4.2 โ she's been around a minute, a true veteran ๐
โจ REPORTING BUGS โจ
found a bug? don't gatekeep it, report it 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. so like, go off, but keep the receipts bestie ๐ซถ
โจ 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, version 3.8.13, on the gnutls_pkcs7_verify(3) page โ go verify something and slay โจ๐๐
๐ฆ 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