---
name: "PKCS7_get_octet_string"
section: "3ssl"
platform: "linux"
package: "openssl"
version: "3.6.5-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/PKCS7_get_octet_string"
---

# PKCS7\_get\_octet\_string(3ssl)

return octet string from a PKCS#7 envelopedData structure

## NAME

PKCS7\_get\_octet\_string - return octet string from a PKCS#7 envelopedData structure

## SYNOPSIS

```
 #include <openssl/pkcs7.h>
 ASN1_OCTET_STRING *PKCS7_get_octet_string(PKCS7 *p7);
```

## DESCRIPTION

**PKCS7\_get\_octet\_string()** returns a pointer to an ASN1 octet string from a PKCS#7 envelopedData structure or **NULL** if the structure cannot be parsed.

## NOTES

As the **0** implies, **PKCS7\_get\_octet\_string()** returns internal pointers which should not be freed by the caller.

## RETURN VALUES

**PKCS7\_get\_octet\_string()** returns an ASN1\_OCTET\_STRING pointer.

## SEE ALSO

**PKCS7\_type\_is\_data**(3)

## COPYRIGHT

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\>.
