xref: /netbsd-src/crypto/external/bsd/openssl.old/dist/doc/man3/CMS_get0_SignerInfos.pod (revision 4724848cf0da353df257f730694b7882798e5daf)
1*4724848cSchristos=pod
2*4724848cSchristos
3*4724848cSchristos=head1 NAME
4*4724848cSchristos
5*4724848cSchristosCMS_SignerInfo_set1_signer_cert,
6*4724848cSchristosCMS_get0_SignerInfos, CMS_SignerInfo_get0_signer_id,
7*4724848cSchristosCMS_SignerInfo_get0_signature, CMS_SignerInfo_cert_cmp
8*4724848cSchristos- CMS signedData signer functions
9*4724848cSchristos
10*4724848cSchristos=head1 SYNOPSIS
11*4724848cSchristos
12*4724848cSchristos #include <openssl/cms.h>
13*4724848cSchristos
14*4724848cSchristos STACK_OF(CMS_SignerInfo) *CMS_get0_SignerInfos(CMS_ContentInfo *cms);
15*4724848cSchristos
16*4724848cSchristos int CMS_SignerInfo_get0_signer_id(CMS_SignerInfo *si, ASN1_OCTET_STRING **keyid,
17*4724848cSchristos                                   X509_NAME **issuer, ASN1_INTEGER **sno);
18*4724848cSchristos ASN1_OCTET_STRING *CMS_SignerInfo_get0_signature(CMS_SignerInfo *si);
19*4724848cSchristos int CMS_SignerInfo_cert_cmp(CMS_SignerInfo *si, X509 *cert);
20*4724848cSchristos void CMS_SignerInfo_set1_signer_cert(CMS_SignerInfo *si, X509 *signer);
21*4724848cSchristos
22*4724848cSchristos=head1 DESCRIPTION
23*4724848cSchristos
24*4724848cSchristosThe function CMS_get0_SignerInfos() returns all the CMS_SignerInfo structures
25*4724848cSchristosassociated with a CMS signedData structure.
26*4724848cSchristos
27*4724848cSchristosCMS_SignerInfo_get0_signer_id() retrieves the certificate signer identifier
28*4724848cSchristosassociated with a specific CMS_SignerInfo structure B<si>. Either the
29*4724848cSchristoskeyidentifier will be set in B<keyid> or B<both> issuer name and serial number
30*4724848cSchristosin B<issuer> and B<sno>.
31*4724848cSchristos
32*4724848cSchristosCMS_SignerInfo_get0_signature() retrieves the signature associated with
33*4724848cSchristosB<si> in a pointer to an ASN1_OCTET_STRING structure. This pointer returned
34*4724848cSchristoscorresponds to the internal signature value if B<si> so it may be read or
35*4724848cSchristosmodified.
36*4724848cSchristos
37*4724848cSchristosCMS_SignerInfo_cert_cmp() compares the certificate B<cert> against the signer
38*4724848cSchristosidentifier B<si>. It returns zero if the comparison is successful and non zero
39*4724848cSchristosif not.
40*4724848cSchristos
41*4724848cSchristosCMS_SignerInfo_set1_signer_cert() sets the signers certificate of B<si> to
42*4724848cSchristosB<signer>.
43*4724848cSchristos
44*4724848cSchristos=head1 NOTES
45*4724848cSchristos
46*4724848cSchristosThe main purpose of these functions is to enable an application to lookup
47*4724848cSchristossigners certificates using any appropriate technique when the simpler method
48*4724848cSchristosof CMS_verify() is not appropriate.
49*4724848cSchristos
50*4724848cSchristosIn typical usage and application will retrieve all CMS_SignerInfo structures
51*4724848cSchristosusing CMS_get0_SignerInfo() and retrieve the identifier information using
52*4724848cSchristosCMS. It will then obtain the signer certificate by some unspecified means
53*4724848cSchristos(or return and error if it cannot be found) and set it using
54*4724848cSchristosCMS_SignerInfo_set1_signer_cert().
55*4724848cSchristos
56*4724848cSchristosOnce all signer certificates have been set CMS_verify() can be used.
57*4724848cSchristos
58*4724848cSchristosAlthough CMS_get0_SignerInfos() can return NULL if an error occurs B<or> if
59*4724848cSchristosthere are no signers this is not a problem in practice because the only
60*4724848cSchristoserror which can occur is if the B<cms> structure is not of type signedData
61*4724848cSchristosdue to application error.
62*4724848cSchristos
63*4724848cSchristos=head1 RETURN VALUES
64*4724848cSchristos
65*4724848cSchristosCMS_get0_SignerInfos() returns all CMS_SignerInfo structures, or NULL there
66*4724848cSchristosare no signers or an error occurs.
67*4724848cSchristos
68*4724848cSchristosCMS_SignerInfo_get0_signer_id() returns 1 for success and 0 for failure.
69*4724848cSchristos
70*4724848cSchristosCMS_SignerInfo_cert_cmp() returns 0 for a successful comparison and non
71*4724848cSchristoszero otherwise.
72*4724848cSchristos
73*4724848cSchristosCMS_SignerInfo_set1_signer_cert() does not return a value.
74*4724848cSchristos
75*4724848cSchristosAny error can be obtained from L<ERR_get_error(3)>
76*4724848cSchristos
77*4724848cSchristos=head1 SEE ALSO
78*4724848cSchristos
79*4724848cSchristosL<ERR_get_error(3)>, L<CMS_verify(3)>
80*4724848cSchristos
81*4724848cSchristos=head1 COPYRIGHT
82*4724848cSchristos
83*4724848cSchristosCopyright 2008-2018 The OpenSSL Project Authors. All Rights Reserved.
84*4724848cSchristos
85*4724848cSchristosLicensed under the OpenSSL license (the "License").  You may not use
86*4724848cSchristosthis file except in compliance with the License.  You can obtain a copy
87*4724848cSchristosin the file LICENSE in the source distribution or at
88*4724848cSchristosL<https://www.openssl.org/source/license.html>.
89*4724848cSchristos
90*4724848cSchristos=cut
91