pkcs7_validate_trust(9)
π pkcs7_validate_trust π
okay so bestie, welcome to the kernel API manual for pkcs7_validate_trust β she's a function, she lives in the kernel, and honestly? she's doing the most important vibe check of your entire life: is this certificate chain actually trusted or is it giving stranger danger π΅οΈββοΈβ¨
πΈ NAME πΈ
pkcs7_validate_trust β validate the PKCS#7 trust chain, no cap π₯
π SYNOPSIS π
int pkcs7_validate_trust (struct pkcs7_message *pkcs7 , struct key
*trust_keyring );
like, that's her whole signature, and yes she returns an int, she's an icon π
π¦ ARGUMENTS π¦
pkcs7β The PKCS#7 certificate to validate. this is the main character of the operation, the one getting checked πtrust_keyringβ Signing certificates to use as starting points. think of these as the trusted besties you're like "ok if these girlies vouch for you, you're in" π«Ά
β DESCRIPTION β
So here's the tea β: pkcs7_validate_trust validates that the certificate chain inside the PKCS#7 message intersects keys we already know and trust. literally a "do I know you?? do WE have mutuals??" situation π
She returns, in order of descending priority (yes bestie, priority order matters, read them in this order ngl):
-EKEYREJECTEDif a signature failed to match for which we have a valid key β π the fraud detector went OFF, we had a key and the signature did NOT match. or:0if at least one signature chain intersects with the keys in the trust keyring β slay!! mutuals confirmed, trust established β¨ or:-ENOPKGif a suitable crypto module couldn't be found for a check on a chain β like we literally couldn't find the right tool for the job π-ENOKEYif we couldn't find a match for any of the signature chains in the message β nobody knows this cert, we have zero mutuals, blocked π«
May also return -ENOMEM β because of course, memory said "not today" π
fr fr, watch the ordering: a matching failure with a valid key (-EKEYREJECTED) outranks a success (0), which outranks-ENOPKG, which outranks-ENOKEY. and-ENOMEMcan just show up whenever it wants, rude.
π SEE ALSO π
- Kernel file
./crypto/asymmetric_keys/pkcs7_trust.cβ go read the source bestie, it's right there π§ββοΈ
and that's the whole page gorgeous π this one's from the ./crypto/asymmetric_keys corner of the kernel, dated October 2026 β periodt, go validate some trust chains ππΈ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms