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