CMS_GET0_SIGNERINFOS(3SSL)
π CMS_GET0_SIGNERINFOS π
okay bestie, this is the OpenSSL page for the CMS signedData signer functions β that's manual section 3SSL btw, so you're in the right place π«Ά
The girlies we're covering: CMS_SignerInfo_set1_signer_cert, CMS_get0_SignerInfos, CMS_SignerInfo_get0_signer_id, CMS_SignerInfo_get0_signature, and CMS_SignerInfo_cert_cmp. They're all about poking at the signers inside a CMS signedData thing. π
β¨ 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 hands you all the CMS_SignerInfo structures chillin' inside a CMS signedData structure. all of them. the whole squad. π«
CMS_SignerInfo_get0_signer_id() β retrieves the certificate signer identifier that goes with a specific CMS_SignerInfo structure, aka si. And it's an either/or situation, so pay attention: either the keyidentifier gets set in keyid, or both the issuer name and the serial number land in issuer and sno. π
CMS_SignerInfo_get0_signature() β grabs the signature linked to si and gives it to you as a pointer to an ASN1_OCTET_STRING structure. and here's the tea: that returned pointer corresponds to the internal signature value if si, so you can read it or modify it. it's giving direct access, no middleman π
CMS_SignerInfo_cert_cmp() β compares the certificate cert against the signer identifier si. returns zero if the comparison slays (successful) and non zero if it doesn't. π
CMS_SignerInfo_set1_signer_cert() β sets the signer's certificate of si to signer. that's it, that's the whole job. β¨
π NOTES π
The main purpose of these functions? To let an application look up signers' certificates using any appropriate technique β for when the simpler method of CMS_verify() just isn't appropriate. sometimes you gotta do it yourself, bestie. πββοΈ
In typical usage and 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 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() can be used. π
okay so real talk βCMS_get0_SignerInfos()can returnNULLif an error occurs or if there are no signers at all. But ngl this isn't actually a problem in practice, because the only error that can occur is if thecmsstructure is not of type signedData, and that'd be due to an application error. so like, it's a you problem at that point π
π¦ RETURN VALUES π¦
CMS_get0_SignerInfos()returns allCMS_SignerInfostructures, orNULLthere 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) π«Ά
π 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 little baddie is 4.0.3, dated 2026-09-29, from the OpenSSL girlies themselves. go forth and look up those signer certificates, no cap ππ
π¦ where this page comes from
- ubuntu stonking: libssl-doc 4.0.3-1ubuntu1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms