1CMS_ADD0_CERT(3)                    OpenSSL                   CMS_ADD0_CERT(3)
2
3
4

NAME

6       CMS_add0_cert, CMS_add1_cert, CMS_get1_certs, CMS_add0_crl,
7       CMS_add1_crl, CMS_get1_crls - CMS certificate and CRL utility functions
8

SYNOPSIS

10        #include <openssl/cms.h>
11
12        int CMS_add0_cert(CMS_ContentInfo *cms, X509 *cert);
13        int CMS_add1_cert(CMS_ContentInfo *cms, X509 *cert);
14        STACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms);
15
16        int CMS_add0_crl(CMS_ContentInfo *cms, X509_CRL *crl);
17        int CMS_add1_crl(CMS_ContentInfo *cms, X509_CRL *crl);
18        STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms);
19

DESCRIPTION

21       CMS_add0_cert() and CMS_add1_cert() add certificate cert to cms.  must
22       be of type signed data or enveloped data.
23
24       CMS_get1_certs() returns all certificates in cms.
25
26       CMS_add0_crl() and CMS_add1_crl() add CRL crl to cms. CMS_get1_crls()
27       returns any CRLs in cms.
28

NOTES

30       The CMS_ContentInfo structure cms must be of type signed data or
31       enveloped data or an error will be returned.
32
33       For signed data certificates and CRLs are added to the certificates and
34       crls fields of SignedData structure. For enveloped data they are added
35       to OriginatorInfo.
36
37       As the 0 implies CMS_add0_cert() adds cert internally to cms and it
38       must not be freed up after the call as opposed to CMS_add1_cert() where
39       cert must be freed up.
40
41       The same certificate or CRL must not be added to the same cms structure
42       more than once.
43

RETURN VALUES

45       CMS_add0_cert(), CMS_add1_cert() and CMS_add0_crl() and CMS_add1_crl()
46       return 1 for success and 0 for failure.
47
48       CMS_get1_certs() and CMS_get1_crls() return the STACK of certificates
49       or CRLs or NULL if there are none or an error occurs. The only error
50       which will occur in practice is if the cms type is invalid.
51

SEE ALSO

53       ERR_get_error(3), CMS_sign(3), CMS_encrypt(3)
54
56       Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
57
58       Licensed under the OpenSSL license (the "License").  You may not use
59       this file except in compliance with the License.  You can obtain a copy
60       in the file LICENSE in the source distribution or at
61       <https://www.openssl.org/source/license.html>.
62
63
64
651.1.1c                            2019-05-28                  CMS_ADD0_CERT(3)
Impressum