xref: /freebsd-src/crypto/openssl/doc/man3/CMS_add0_cert.pod (revision e71b70530d95c4f34d8bdbd78d1242df1ba4a945)
1*e71b7053SJung-uk Kim=pod
2*e71b7053SJung-uk Kim
3*e71b7053SJung-uk Kim=head1 NAME
4*e71b7053SJung-uk Kim
5*e71b7053SJung-uk KimCMS_add0_cert, CMS_add1_cert, CMS_get1_certs, CMS_add0_crl, CMS_add1_crl, CMS_get1_crls
6*e71b7053SJung-uk Kim- CMS certificate and CRL utility functions
7*e71b7053SJung-uk Kim
8*e71b7053SJung-uk Kim=head1 SYNOPSIS
9*e71b7053SJung-uk Kim
10*e71b7053SJung-uk Kim #include <openssl/cms.h>
11*e71b7053SJung-uk Kim
12*e71b7053SJung-uk Kim int CMS_add0_cert(CMS_ContentInfo *cms, X509 *cert);
13*e71b7053SJung-uk Kim int CMS_add1_cert(CMS_ContentInfo *cms, X509 *cert);
14*e71b7053SJung-uk Kim STACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms);
15*e71b7053SJung-uk Kim
16*e71b7053SJung-uk Kim int CMS_add0_crl(CMS_ContentInfo *cms, X509_CRL *crl);
17*e71b7053SJung-uk Kim int CMS_add1_crl(CMS_ContentInfo *cms, X509_CRL *crl);
18*e71b7053SJung-uk Kim STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms);
19*e71b7053SJung-uk Kim
20*e71b7053SJung-uk Kim=head1 DESCRIPTION
21*e71b7053SJung-uk Kim
22*e71b7053SJung-uk KimCMS_add0_cert() and CMS_add1_cert() add certificate B<cert> to B<cms>.
23*e71b7053SJung-uk Kimmust be of type signed data or enveloped data.
24*e71b7053SJung-uk Kim
25*e71b7053SJung-uk KimCMS_get1_certs() returns all certificates in B<cms>.
26*e71b7053SJung-uk Kim
27*e71b7053SJung-uk KimCMS_add0_crl() and CMS_add1_crl() add CRL B<crl> to B<cms>. CMS_get1_crls()
28*e71b7053SJung-uk Kimreturns any CRLs in B<cms>.
29*e71b7053SJung-uk Kim
30*e71b7053SJung-uk Kim=head1 NOTES
31*e71b7053SJung-uk Kim
32*e71b7053SJung-uk KimThe CMS_ContentInfo structure B<cms> must be of type signed data or enveloped
33*e71b7053SJung-uk Kimdata or an error will be returned.
34*e71b7053SJung-uk Kim
35*e71b7053SJung-uk KimFor signed data certificates and CRLs are added to the B<certificates> and
36*e71b7053SJung-uk KimB<crls> fields of SignedData structure. For enveloped data they are added to
37*e71b7053SJung-uk KimB<OriginatorInfo>.
38*e71b7053SJung-uk Kim
39*e71b7053SJung-uk KimAs the B<0> implies CMS_add0_cert() adds B<cert> internally to B<cms> and it
40*e71b7053SJung-uk Kimmust not be freed up after the call as opposed to CMS_add1_cert() where B<cert>
41*e71b7053SJung-uk Kimmust be freed up.
42*e71b7053SJung-uk Kim
43*e71b7053SJung-uk KimThe same certificate or CRL must not be added to the same cms structure more
44*e71b7053SJung-uk Kimthan once.
45*e71b7053SJung-uk Kim
46*e71b7053SJung-uk Kim=head1 RETURN VALUES
47*e71b7053SJung-uk Kim
48*e71b7053SJung-uk KimCMS_add0_cert(), CMS_add1_cert() and CMS_add0_crl() and CMS_add1_crl() return
49*e71b7053SJung-uk Kim1 for success and 0 for failure.
50*e71b7053SJung-uk Kim
51*e71b7053SJung-uk KimCMS_get1_certs() and CMS_get1_crls() return the STACK of certificates or CRLs
52*e71b7053SJung-uk Kimor NULL if there are none or an error occurs. The only error which will occur
53*e71b7053SJung-uk Kimin practice is if the B<cms> type is invalid.
54*e71b7053SJung-uk Kim
55*e71b7053SJung-uk Kim=head1 SEE ALSO
56*e71b7053SJung-uk Kim
57*e71b7053SJung-uk KimL<ERR_get_error(3)>,
58*e71b7053SJung-uk KimL<CMS_sign(3)>,
59*e71b7053SJung-uk KimL<CMS_encrypt(3)>
60*e71b7053SJung-uk Kim
61*e71b7053SJung-uk Kim=head1 COPYRIGHT
62*e71b7053SJung-uk Kim
63*e71b7053SJung-uk KimCopyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
64*e71b7053SJung-uk Kim
65*e71b7053SJung-uk KimLicensed under the OpenSSL license (the "License").  You may not use
66*e71b7053SJung-uk Kimthis file except in compliance with the License.  You can obtain a copy
67*e71b7053SJung-uk Kimin the file LICENSE in the source distribution or at
68*e71b7053SJung-uk KimL<https://www.openssl.org/source/license.html>.
69*e71b7053SJung-uk Kim
70*e71b7053SJung-uk Kim=cut
71