1238384Sjkim=pod
2238384Sjkim
3238384Sjkim=head1 NAME
4238384Sjkim
5238384Sjkim CMS_add0_cert, CMS_add1_cert, CMS_get1_certs, CMS_add0_crl, CMS_get1_crls, - CMS certificate and CRL utility functions
6238384Sjkim
7238384Sjkim=head1 SYNOPSIS
8238384Sjkim
9238384Sjkim #include <openssl/cms.h>
10238384Sjkim
11238384Sjkim int CMS_add0_cert(CMS_ContentInfo *cms, X509 *cert);
12238384Sjkim int CMS_add1_cert(CMS_ContentInfo *cms, X509 *cert);
13238384Sjkim STACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms);
14238384Sjkim
15238384Sjkim int CMS_add0_crl(CMS_ContentInfo *cms, X509_CRL *crl);
16238384Sjkim int CMS_add1_crl(CMS_ContentInfo *cms, X509_CRL *crl);
17238384Sjkim STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms);
18238384Sjkim
19238384Sjkim
20238384Sjkim=head1 DESCRIPTION
21238384Sjkim
22238384SjkimCMS_add0_cert() and CMS_add1_cert() add certificate B<cert> to B<cms>.
23238384Sjkimmust be of type signed data or enveloped data. 
24238384Sjkim
25238384SjkimCMS_get1_certs() returns all certificates in B<cms>.
26238384Sjkim
27238384SjkimCMS_add0_crl() and CMS_add1_crl() add CRL B<crl> to B<cms>. CMS_get1_crls()
28238384Sjkimreturns any CRLs in B<cms>.
29238384Sjkim
30238384Sjkim=head1 NOTES
31238384Sjkim
32238384SjkimThe CMS_ContentInfo structure B<cms> must be of type signed data or enveloped
33238384Sjkimdata or an error will be returned.
34238384Sjkim
35238384SjkimFor signed data certificates and CRLs are added to the B<certificates> and
36238384SjkimB<crls> fields of SignedData structure. For enveloped data they are added to
37238384SjkimB<OriginatorInfo>.
38238384Sjkim
39238384SjkimAs the B<0> implies CMS_add0_cert() adds B<cert> internally to B<cms> and it
40238384Sjkimmust not be freed up after the call as opposed to CMS_add1_cert() where B<cert>
41238384Sjkimmust be freed up.
42238384Sjkim
43238384SjkimThe same certificate or CRL must not be added to the same cms structure more
44238384Sjkimthan once.
45238384Sjkim
46238384Sjkim=head1 RETURN VALUES
47238384Sjkim
48238384SjkimCMS_add0_cert(), CMS_add1_cert() and CMS_add0_crl() and CMS_add1_crl() return
49238384Sjkim1 for success and 0 for failure. 
50238384Sjkim
51238384SjkimCMS_get1_certs() and CMS_get1_crls() return the STACK of certificates or CRLs
52238384Sjkimor NULL if there are none or an error occurs. The only error which will occur
53238384Sjkimin practice is if the B<cms> type is invalid.
54238384Sjkim
55238384Sjkim=head1 SEE ALSO
56238384Sjkim
57238384SjkimL<ERR_get_error(3)|ERR_get_error(3)>,
58238384SjkimL<CMS_sign(3)|CMS_sign(3)>,
59238384SjkimL<CMS_encrypt(3)|CMS_encrypt(3)>
60238384Sjkim
61238384Sjkim=head1 HISTORY
62238384Sjkim
63238384SjkimCMS_add0_cert(), CMS_add1_cert(), CMS_get1_certs(), CMS_add0_crl()
64238384Sjkimand CMS_get1_crls() were all first added to OpenSSL 0.9.8
65238384Sjkim
66238384Sjkim=cut
67