PKCS7_GET_OCTET_STRING(3ossl)

πŸ“¦ version 3.5.0, in opensuse-leap 16.0

okay bestie, welcome to the PKCS7_GET_OCTET_STRING(3ossl) page β€” yes, that's the manual name, and yes, we're getting into it πŸ’…

πŸ’– NAME πŸ’–

PKCS7_get_octet_string β€” returns an octet string from a PKCS#7 envelopedData structure. That's the whole errand, no cap. ✨

✨ SYNOPSIS ✨

#include <openssl/pkcs7.h>

ASN1_OCTET_STRING *PKCS7_get_octet_string(PKCS7 *p7);

πŸ¦‹ DESCRIPTION πŸ¦‹

PKCS7_get_octet_string() hands you a pointer to an ASN1 octet string from a PKCS#7 envelopedData structure. Slay.

If the structure cannot be parsed, it returns NULL β€” that's the β€œnope, couldn't parse this” moment 😭.

πŸŽ€ NOTES πŸŽ€

As the 0 implies, PKCS7_get_octet_string() returns internal pointers, and the caller should not free them. Like, hands off, bestie β€” do not free() these. 🫢

πŸ”₯ RETURN VALUES πŸ”₯

PKCS7_get_octet_string() returns an ASN1_OCTET_STRING pointer. And if parsing fails, remember that NULL from DESCRIPTION β€” vibe check failed, but the function still returned its pointer type. πŸ‘‘

🌈 SEE ALSO 🌈

PKCS7_type_is_data(3) β€” go read that next, iykyk.

Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.


That's the PKCS7_GET_OCTET_STRING(3ossl) tea, fresh from OpenSSL 3.5.0, dated 2026-09-25 πŸ«ΆπŸ’–

πŸ“¦ where this page comes from