gnutls_pkcs8_info(3)
β¨ NAME β¨
gnutls_pkcs8_info β bestie, this is an API function and it's literally here to spill the tea on your PKCS 8 structure π
(It lives in the gnutls manual, section 3, in case you were wondering where this came from π)
πΈ SYNOPSIS πΈ
#include <gnutls/x509.h>
int gnutls_pkcs8_info(const gnutls_datum_t * data, gnutls_x509_crt_fmt_t
format, unsigned int * schema, unsigned int * cipher, void * salt,
unsigned int * salt_size, unsigned int * iter_count, char ** oid);
okay so it's giving very "eight arguments, no notes" π but we're gonna walk through every single one, don't you worry π«Ά
π¦ ARGUMENTS π¦
const gnutls_datum_t * dataβ holds the PKCS 8 data. this is the thing we're snooping on πgnutls_x509_crt_fmt_t formatβ the format of the PKCS 8 data. you gotta tell it what flavor you're handing over πunsigned int * schemaβ this one comes back indicating the schema as one ofgnutls_pkcs_encrypt_flags_tβ¨unsigned int * cipherβ the cipher that got used, reported as agnutls_cipher_algorithm_tπ₯void * saltβ PBKDF2 salt, and here's the lil trick: if it's non-NULL thensalt_sizeinitially holds its size. so it's a two-way street, okay? πunsigned int * salt_sizeβ PBKDF2 salt size. yes it does double duty, we already covered that, keep up bestie πunsigned int * iter_countβ PBKDF2 iteration count. the number of times it stirred the pot π₯char ** oidβ if it's non-NULL it will contain an allocated null-terminated variable with the OID. like, an actual string, freshly allocated, just for you π
π DESCRIPTION π
So this function will provide information on the algorithms used in a particular PKCS 8 structure. That's the whole gig. It looks at your blob and tells you what's inside it π΅οΈββοΈ
But here's the plot twist: if the structure algorithms are unknown, the code GNUTLS_E_UNKNOWN_CIPHER_TYPE will be returned, and only oid will be set. That's right β only the oid. Everything else is just sitting there unset like π
And that's not a bug, that's by design, bestie: oid will be set on encrypted PKCS 8 structures whether supported or not. So it's the one reliable friend in the group chat π«Ά
π¨ IMPORTANT: thatoidmust be deinitialized usinggnutls_free(). Do NOT forget. Do NOT be that girl. Free your memory, periodt.
The other variables β schema, cipher, salt, salt_size, iter_count β are only set on supported structures. If the structure isn't supported, they're giving nothing π
β RETURNS β
GNUTLS_E_INVALID_REQUESTβ if the provided structure isn't an encrypted key. like, wrong girl, wrong party π«GNUTLS_E_UNKNOWN_CIPHER_TYPEβ if the structure's encryption isn't supported. we don't know her π- another negative error code β in case of a failure. any other kind of L π
- Zero β on success. the slay. the moment. the 0οΈβ£ we've been waiting for π
π SINCE π
3.4.0 β she's been around since 3.4.0, an icon, a legend, and she is the moment β¨
π REPORTING BUGS π
Found a bug? Not on my watch, but also please tell the people who can actually fix it:
- 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. so yes, you may copy it, no cap, just keep the notice, 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/
like, go read the whole thing, it's giving encyclopedia but make it cute πβ¨
okay bye ily, this was gnutls_pkcs8_info(3) from the gnutls manual, version 3.8.13, and honestly? she ate π
β¨π¦
π¦ 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