---
name: "libressl-CMS_get0_SignerInfos"
section: "3"
platform: "linux"
package: "libressl"
version: "4.4.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libressl-CMS_get0_SignerInfos"
---

# libressl-CMS\_get0\_SignerInfos(3)

CMS SignedData signer functions

## NAME

**CMS\_get0\_SignerInfos**, **CMS\_SignerInfo\_get\_version**, **CMS\_SignerInfo\_get0\_signer\_id**, **CMS\_SignerInfo\_get0\_signature**, **CMS\_SignerInfo\_cert\_cmp**, **CMS\_SignerInfo\_set1\_signer\_cert** – CMS SignedData signer functions

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

**#include \<openssl/cms.h\>**

*STACK\_OF(CMS\_SignerInfo)* *\**\

**CMS\_get0\_SignerInfos**(*CMS\_ContentInfo \*cms*);

*int*\

**CMS\_SignerInfo\_get\_version**(*CMS\_SignerInfo \*si*, *long \*version*);

*int*\

**CMS\_SignerInfo\_get0\_signer\_id**(*CMS\_SignerInfo \*si*, *ASN1\_OCTET\_STRING \*\*keyid*, *X509\_NAME \*\*issuer*, *ASN1\_INTEGER \*\*sno*);

*ASN1\_OCTET\_STRING* *\**\

**CMS\_SignerInfo\_get0\_signature**(*CMS\_SignerInfo \*si*);

*int*\

**CMS\_SignerInfo\_cert\_cmp**(*CMS\_SignerInfo \*si*, *X509 \*certificate*);

*void*\

**CMS\_SignerInfo\_set1\_signer\_cert**(*CMS\_SignerInfo \*si*, *X509 \*signer*);

## DESCRIPTION

**CMS\_get0\_SignerInfos**() returns all the *SignerInfo* structures associated with the *SignedData* structure *cms*.

**CMS\_SignerInfo\_get\_version**() sets \**version* to the syntax version number of the *SignerInfo* structure *si*.

**CMS\_SignerInfo\_get0\_signer\_id**() retrieves the certificate *SignerIdentifier* associated with the *SignerInfo* structure *si*. Either the *SubjectKeyIdentifier* will be set in *keyid* or both issuer name and serial number in *issuer* and *sno*.

**CMS\_SignerInfo\_get0\_signature**() retrieves the *signature* field of *si*. The application program is allowed to modify the data pointed to.

**CMS\_SignerInfo\_cert\_cmp**() compares the *certificate* against the signer identifier of *si*.

**CMS\_SignerInfo\_set1\_signer\_cert**() sets the signer certificate of *si* to *signer*.

The main purpose of these functions is to enable an application to look up signer certificates using any appropriate technique when the simpler method of CMS\_verify(3) is not appropriate.

In typical usage, an application retrieves all *CMS\_SignerInfo* structures using **CMS\_get0\_SignerInfos**() and retrieves the identifier information using CMS. It will then obtain the signer certificate by some unspecified means (or return and error if it cannot be found) and set it using **CMS\_SignerInfo\_set1\_signer\_cert**(). Once all signer certificates have been set, CMS\_verify(3) can be used.

## RETURN VALUES

**CMS\_get0\_SignerInfos**() returns an internal pointer to all the *CMS\_SignerInfo* structures, or NULL if there are no signers or if *cms* is not of the type *SignedData*.

**CMS\_SignerInfo\_get\_version**() always succeeds and returns 1.

**CMS\_SignerInfo\_get0\_signer\_id**() returns 1 for success or 0 for failure.

**CMS\_SignerInfo\_get0\_signature**() returns an internal pointer to the signature.

**CMS\_SignerInfo\_cert\_cmp**() returns 0 for a match or non-zero otherwise.

Any error can be obtained from ERR\_get\_error(3).

## SEE ALSO

CMS\_ContentInfo\_new(3), CMS\_signed\_add1\_attr(3), CMS\_verify(3)

## STANDARDS

RFC 5652: Cryptographic Message Syntax (CMS)

- section 5.1: SignedData Type

- section 5.3: SignerInfo Type

## HISTORY

**CMS\_get0\_SignerInfos**(), **CMS\_SignerInfo\_get0\_signer\_id**(), **CMS\_SignerInfo\_cert\_cmp**(), and **CMS\_SignerInfo\_set1\_signer\_cert**() first appeared in OpenSSL 0.9.8h and **CMS\_SignerInfo\_get0\_signature**() in OpenSSL 1.0.2. These functions have been available since OpenBSD 6.7.

**CMS\_SignerInfo\_get\_version**() first appeared in OpenBSD 7.4.
