xref: /minix3/crypto/external/bsd/openssl/dist/doc/crypto/CMS_add0_cert.pod (revision ebfedea0ce5bbe81e252ddf32d732e40fb633fae)
1*ebfedea0SLionel Sambuc=pod
2*ebfedea0SLionel Sambuc
3*ebfedea0SLionel Sambuc=head1 NAME
4*ebfedea0SLionel Sambuc
5*ebfedea0SLionel Sambuc CMS_add0_cert, CMS_add1_cert, CMS_get1_certs, CMS_add0_crl, CMS_get1_crls, - CMS certificate and CRL utility functions
6*ebfedea0SLionel Sambuc
7*ebfedea0SLionel Sambuc=head1 SYNOPSIS
8*ebfedea0SLionel Sambuc
9*ebfedea0SLionel Sambuc #include <openssl/cms.h>
10*ebfedea0SLionel Sambuc
11*ebfedea0SLionel Sambuc int CMS_add0_cert(CMS_ContentInfo *cms, X509 *cert);
12*ebfedea0SLionel Sambuc int CMS_add1_cert(CMS_ContentInfo *cms, X509 *cert);
13*ebfedea0SLionel Sambuc STACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms);
14*ebfedea0SLionel Sambuc
15*ebfedea0SLionel Sambuc int CMS_add0_crl(CMS_ContentInfo *cms, X509_CRL *crl);
16*ebfedea0SLionel Sambuc int CMS_add1_crl(CMS_ContentInfo *cms, X509_CRL *crl);
17*ebfedea0SLionel Sambuc STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms);
18*ebfedea0SLionel Sambuc
19*ebfedea0SLionel Sambuc
20*ebfedea0SLionel Sambuc=head1 DESCRIPTION
21*ebfedea0SLionel Sambuc
22*ebfedea0SLionel SambucCMS_add0_cert() and CMS_add1_cert() add certificate B<cert> to B<cms>.
23*ebfedea0SLionel Sambucmust be of type signed data or enveloped data.
24*ebfedea0SLionel Sambuc
25*ebfedea0SLionel SambucCMS_get1_certs() returns all certificates in B<cms>.
26*ebfedea0SLionel Sambuc
27*ebfedea0SLionel SambucCMS_add0_crl() and CMS_add1_crl() add CRL B<crl> to B<cms>. CMS_get1_crls()
28*ebfedea0SLionel Sambucreturns any CRLs in B<cms>.
29*ebfedea0SLionel Sambuc
30*ebfedea0SLionel Sambuc=head1 NOTES
31*ebfedea0SLionel Sambuc
32*ebfedea0SLionel SambucThe CMS_ContentInfo structure B<cms> must be of type signed data or enveloped
33*ebfedea0SLionel Sambucdata or an error will be returned.
34*ebfedea0SLionel Sambuc
35*ebfedea0SLionel SambucFor signed data certificates and CRLs are added to the B<certificates> and
36*ebfedea0SLionel SambucB<crls> fields of SignedData structure. For enveloped data they are added to
37*ebfedea0SLionel SambucB<OriginatorInfo>.
38*ebfedea0SLionel Sambuc
39*ebfedea0SLionel SambucAs the B<0> implies CMS_add0_cert() adds B<cert> internally to B<cms> and it
40*ebfedea0SLionel Sambucmust not be freed up after the call as opposed to CMS_add1_cert() where B<cert>
41*ebfedea0SLionel Sambucmust be freed up.
42*ebfedea0SLionel Sambuc
43*ebfedea0SLionel SambucThe same certificate or CRL must not be added to the same cms structure more
44*ebfedea0SLionel Sambucthan once.
45*ebfedea0SLionel Sambuc
46*ebfedea0SLionel Sambuc=head1 RETURN VALUES
47*ebfedea0SLionel Sambuc
48*ebfedea0SLionel SambucCMS_add0_cert(), CMS_add1_cert() and CMS_add0_crl() and CMS_add1_crl() return
49*ebfedea0SLionel Sambuc1 for success and 0 for failure.
50*ebfedea0SLionel Sambuc
51*ebfedea0SLionel SambucCMS_get1_certs() and CMS_get1_crls() return the STACK of certificates or CRLs
52*ebfedea0SLionel Sambucor NULL if there are none or an error occurs. The only error which will occur
53*ebfedea0SLionel Sambucin practice is if the B<cms> type is invalid.
54*ebfedea0SLionel Sambuc
55*ebfedea0SLionel Sambuc=head1 SEE ALSO
56*ebfedea0SLionel Sambuc
57*ebfedea0SLionel SambucL<ERR_get_error(3)|ERR_get_error(3)>,
58*ebfedea0SLionel SambucL<CMS_sign(3)|CMS_sign(3)>,
59*ebfedea0SLionel SambucL<CMS_encrypt(3)|CMS_encrypt(3)>
60*ebfedea0SLionel Sambuc
61*ebfedea0SLionel Sambuc=head1 HISTORY
62*ebfedea0SLionel Sambuc
63*ebfedea0SLionel SambucCMS_add0_cert(), CMS_add1_cert(), CMS_get1_certs(), CMS_add0_crl()
64*ebfedea0SLionel Sambucand CMS_get1_crls() were all first added to OpenSSL 0.9.8
65*ebfedea0SLionel Sambuc
66*ebfedea0SLionel Sambuc=cut
67