CMS_GET0_SIGNERINFOS(3ossl)
β¨ CMS_GET0_SIGNERINFOS β¨
okay bestie, pull up a chair π this is the 3ossl manual page for the CMS signedData signer squad β all the little functions that let you peek at, and poke at, the signers inside a CMS structure. no cap, it's giving "backstage pass to the signers" energy.
πΈ NAME πΈ
CMS_SignerInfo_set1_signer_cert, CMS_get0_SignerInfos, CMS_SignerInfo_get0_signer_id, CMS_SignerInfo_get0_signature, CMS_SignerInfo_cert_cmp β the CMS signedData signer functions, aka the whole friend group π«Ά
π 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() hands you back all the CMS_SignerInfo structures chillin' inside a CMS signedData structure. the whole roster. the full lineup. β
CMS_SignerInfo_get0_signer_id() goes and fetches the certificate signer identifier for one specific CMS_SignerInfo structure, si. and here's the tea: either the keyidentifier gets set in keyid, or you get both the issuer name and the serial number in issuer and sno. it's one or the other, never both, iykyk. π
CMS_SignerInfo_get0_signature() retrieves the signature linked to si, as a pointer to an ASN1_OCTET_STRING structure. and the plot twist: that returned pointer corresponds to the internal signature value of si, so bestie you can literally read it or modify it. main character access fr. π₯
CMS_SignerInfo_cert_cmp() compares the certificate cert against the signer identifier si. returns zero if the comparison slays (successful), and non-zero if not. π
CMS_SignerInfo_set1_signer_cert() sets the signer's certificate of si to signer. simple as that. π
π¦ NOTES π¦
the main purpose of these functions is to let an application look up signers' certificates using whatever technique it vibes with, for when the simpler method of CMS_verify() just isn't it.
in typical usage, an application will grab all the CMS_SignerInfo structures using CMS_get0_SignerInfo() and pull the identifier info using CMS. then it obtains the signer certificate by some unspecified means (or returns an error if it can't be found π) and sets it using CMS_SignerInfo_set1_signer_cert().
once all the signer certificates have been set, CMS_verify() can be used. periodt. β¨
ngl,CMS_get0_SignerInfos()can returnNULLif an error occurs or if there are no signers β but lowkey this is not a problem in practice, because the only error that can occur is if thecmsstructure is not of typesignedData, due to application error. so like, it's fine. π«Ά
π 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. it's giving mysterious. β¨
any error can be obtained from ERR_get_error(3). π
π 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>.
and that's the whole page, bestie π this was 3.5.9, dated 2026-09-29, from the 3ossl manual β slay, go forth and verify those signers π
β¨
π¦ where this page comes from
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms