pkcs7_get_content_data(9)
π pkcs7_get_content_data(9) π
ok so this is a page from the Kernel API Manual β section 9, kernel-ville, and it's all about pkcs7_get_content_data. bestie, we're cracking open a PKCS#7 message and grabbing the actual content out of it. let's go π
β¨ SYNOPSIS β¨
int pkcs7_get_content_data (const struct pkcs7_message *pkcs7 , const
void **_data , size_t *_data_len , size_t *_headerlen );
like, four args, returns an int. not scary, i promise π«Ά
πΈ ARGUMENTS πΈ
pkcs7β the preparsed PKCS#7 message you wanna access. it'sconst, so hands off, we're just looking π_dataβ the place where a pointer to the data gets returned. you hand over the address, it fills in the pointer. classic out-param behavior, lowkey iconic π_data_lenβ the place where the data length gets returned. also an out-param, also doing its thing β¨_headerlenβ the size of the ASN.1 header that is not included in_data. yes, this matters, keep reading π§
π¦ DESCRIPTION π¦
okay so the whole point: you get access to the data content of the PKCS#7 message. that's the vibe. π
and here's the cute part β the size of the header of the ASN.1 object that contains that data is also provided, via _headerlen. so if you want the entire object and not just the inner data, you can use that header length to adjust *_data and *_data_len accordingly. math girl summer π₯
warning-ish but make it factual: it returns -ENODATA if the data object was missing from the message. so likeβ¦ check your return value, bestie π no cap.
π SEE ALSO π
- Kernel file
./crypto/asymmetric_keys/pkcs7_parser.c pkcs7_free_message(9),pkcs7_parse_message(9)
and that's the whole page, periodt. this little gem lives under ./crypto/asymmetric_keys and the manual's dated October 2026 β so it's giving future icon energy βπ mwah, go read the parser file, ily π
π¦ 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