CMS_GET0_SIGNERINFOS(3ossl)

πŸ“¦
version 15.1 Β· 3 versions
, in freebsd 15.1

πŸŽ€ NAME πŸŽ€

Ok bestie, this is CMS_GET0_SIGNERINFOS(3ossl) β€” the OpenSSL manual page for the CMS signedData signer functions: CMS_SignerInfo_set1_signer_cert, CMS_get0_SignerInfos, CMS_SignerInfo_get0_signer_id, CMS_SignerInfo_get0_signature, and CMS_SignerInfo_cert_cmp. It’s giving β€œcertificate detective” energy, and honestly? Obsessed. πŸ’…


✨ SYNOPSIS ✨

#include <openssl/cms.h>

STACK_OF(CMS_SignerInfo) *CMS_get0_SignerInfos(CMS_ContentInfo *cms);

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 *cert);
void CMS_SignerInfo_set1_signer_cert(CMS_SignerInfo *si, X509 *signer);

🌸 DESCRIPTION 🌸

  • CMS_get0_SignerInfos() β€” this one returns all the CMS_SignerInfo structures that are associated with a CMS signedData structure. It’s the β€œgimme the whole squad” function, fr fr.
  • CMS_SignerInfo_get0_signer_id() β€” retrieves the certificate signer identifier associated with a specific CMS_SignerInfo structure si. Either the key identifier gets set in keyid, or both the issuer name and serial number get set in issuer and sno. Two paths, same goal: figure out who signed this thing. πŸ•΅οΈβ€β™€οΈ
  • CMS_SignerInfo_get0_signature() β€” retrieves the signature associated with si as a pointer to an ASN1_OCTET_STRING structure. The pointer you get back points at the internal signature value in si, so you can read it or modify it. Main character pointer behavior, honestly.
  • CMS_SignerInfo_cert_cmp() β€” compares the certificate cert against the signer identifier si. It returns zero if the comparison is successful, and non zero if it isn’t. Simple. Iconic. No cap. βœ…
  • CMS_SignerInfo_set1_signer_cert() β€” sets the signer’s certificate of si to signer. That’s it, that’s the whole vibe. πŸŽ€

πŸ¦‹ NOTES πŸ¦‹

The main purpose of these functions is to let an application look up signer certificates using any appropriate technique when the simpler method of CMS_verify() is not appropriate. So like, when the easy route isn’t it, these functions are your backstage pass. 🫢

In typical usage, an application will retrieve all CMS_SignerInfo structures using CMS_get0_SignerInfo() and retrieve the identifier information using CMS. It will then obtain the signer certificate by some unspecified means β€” or return an error if it cannot be found β€” and set it using CMS_SignerInfo_set1_signer_cert(). Very β€œfind the cert, secure the bag” energy. ✨

Once all signer certificates have been set, CMS_verify() can be used. Slay. πŸ’…

Although CMS_get0_SignerInfos() can return NULL if an error occurs or if there are no signers, this is not a problem in practice because the only error that can occur is if the cms structure is not of type signedData due to application error. So lowkey, if you see NULL, check yourself before you wreck yourself. 😭


🌈 RETURN VALUES 🌈

  • CMS_get0_SignerInfos() β€” returns all CMS_SignerInfo structures, or NULL if there are no signers or an error occurs.
  • CMS_SignerInfo_get0_signer_id() β€” returns 1 for success and 0 for failure.
  • CMS_SignerInfo_cert_cmp() β€” returns 0 for a successful comparison and non zero otherwise.
  • CMS_SignerInfo_set1_signer_cert() β€” does not return a value.

Any error can be obtained from ERR_get_error(3). Error girlies, this one’s for you. πŸ”₯


🧚 SEE ALSO 🧚

ERR_get_error(3), CMS_verify(3)


Copyright 2008-2025 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>.


This page is from OpenSSL 3.5.6, dated 2026-04-07. Byeee bestie, go forth and verify those signers πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from