CMS_GET0_SIGNERINFOS(3ossl)
π 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 theCMS_SignerInfostructures 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 specificCMS_SignerInfostructuresi. Either the key identifier gets set inkeyid, or both the issuer name and serial number get set inissuerandsno. Two paths, same goal: figure out who signed this thing. π΅οΈββοΈCMS_SignerInfo_get0_signature()β retrieves the signature associated withsias a pointer to anASN1_OCTET_STRINGstructure. The pointer you get back points at the internal signature value insi, so you can read it or modify it. Main character pointer behavior, honestly.CMS_SignerInfo_cert_cmp()β compares the certificatecertagainst the signer identifiersi. 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 ofsitosigner. 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 allCMS_SignerInfostructures, orNULLif there are no signers or an error occurs.CMS_SignerInfo_get0_signer_id()β returns1for success and0for failure.CMS_SignerInfo_cert_cmp()β returns0for 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 π
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
- freebsd 15.1: base 15.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms