2008-04-08 22:27:10 +00:00
|
|
|
=pod
|
|
|
|
|
|
|
|
=head1 NAME
|
|
|
|
|
2013-06-12 22:42:08 +00:00
|
|
|
CMS_add0_cert, CMS_add1_cert, CMS_get1_certs, CMS_add0_crl, CMS_add1_crl, CMS_get1_crls, - CMS certificate and CRL utility functions
|
2008-04-08 22:27:10 +00:00
|
|
|
|
|
|
|
=head1 SYNOPSIS
|
|
|
|
|
|
|
|
#include <openssl/cms.h>
|
|
|
|
|
|
|
|
int CMS_add0_cert(CMS_ContentInfo *cms, X509 *cert);
|
|
|
|
int CMS_add1_cert(CMS_ContentInfo *cms, X509 *cert);
|
|
|
|
STACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms);
|
|
|
|
|
|
|
|
int CMS_add0_crl(CMS_ContentInfo *cms, X509_CRL *crl);
|
2008-05-02 17:27:01 +00:00
|
|
|
int CMS_add1_crl(CMS_ContentInfo *cms, X509_CRL *crl);
|
2008-04-08 22:27:10 +00:00
|
|
|
STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms);
|
|
|
|
|
|
|
|
|
|
|
|
=head1 DESCRIPTION
|
|
|
|
|
2008-04-10 23:28:25 +00:00
|
|
|
CMS_add0_cert() and CMS_add1_cert() add certificate B<cert> to B<cms>.
|
2016-05-20 12:11:46 +00:00
|
|
|
must be of type signed data or enveloped data.
|
2008-04-08 22:27:10 +00:00
|
|
|
|
|
|
|
CMS_get1_certs() returns all certificates in B<cms>.
|
|
|
|
|
2008-05-02 17:27:01 +00:00
|
|
|
CMS_add0_crl() and CMS_add1_crl() add CRL B<crl> to B<cms>. CMS_get1_crls()
|
|
|
|
returns any CRLs in B<cms>.
|
2008-04-08 22:27:10 +00:00
|
|
|
|
|
|
|
=head1 NOTES
|
|
|
|
|
2008-04-10 23:28:25 +00:00
|
|
|
The CMS_ContentInfo structure B<cms> must be of type signed data or enveloped
|
|
|
|
data or an error will be returned.
|
|
|
|
|
|
|
|
For signed data certificates and CRLs are added to the B<certificates> and
|
|
|
|
B<crls> fields of SignedData structure. For enveloped data they are added to
|
|
|
|
B<OriginatorInfo>.
|
|
|
|
|
2008-04-08 22:27:10 +00:00
|
|
|
As the B<0> implies CMS_add0_cert() adds B<cert> internally to B<cms> and it
|
|
|
|
must not be freed up after the call as opposed to CMS_add1_cert() where B<cert>
|
|
|
|
must be freed up.
|
|
|
|
|
|
|
|
The same certificate or CRL must not be added to the same cms structure more
|
|
|
|
than once.
|
|
|
|
|
|
|
|
=head1 RETURN VALUES
|
|
|
|
|
2008-05-02 17:27:01 +00:00
|
|
|
CMS_add0_cert(), CMS_add1_cert() and CMS_add0_crl() and CMS_add1_crl() return
|
2016-05-20 12:11:46 +00:00
|
|
|
1 for success and 0 for failure.
|
2008-04-08 22:27:10 +00:00
|
|
|
|
|
|
|
CMS_get1_certs() and CMS_get1_crls() return the STACK of certificates or CRLs
|
|
|
|
or NULL if there are none or an error occurs. The only error which will occur
|
|
|
|
in practice is if the B<cms> type is invalid.
|
|
|
|
|
|
|
|
=head1 SEE ALSO
|
|
|
|
|
2015-08-17 19:21:33 +00:00
|
|
|
L<ERR_get_error(3)>,
|
|
|
|
L<CMS_sign(3)>,
|
|
|
|
L<CMS_encrypt(3)>
|
2008-04-08 22:27:10 +00:00
|
|
|
|
2016-05-18 15:44:05 +00:00
|
|
|
=head1 COPYRIGHT
|
|
|
|
|
|
|
|
Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
|
|
|
|
|
|
|
|
Licensed under the OpenSSL license (the "License"). You may not use
|
|
|
|
this file except in compliance with the License. You can obtain a copy
|
|
|
|
in the file LICENSE in the source distribution or at
|
|
|
|
L<https://www.openssl.org/source/license.html>.
|
|
|
|
|
|
|
|
=cut
|