Add X509_self_signed(), extending and improving documenation and tests
[openssl.git] / doc / internal / man3 / ossl_cmp_sk_X509_add1_cert.pod
1 =pod
2
3 =head1 NAME
4
5 ossl_cmp_sk_X509_add1_cert,
6 ossl_cmp_sk_X509_add1_certs,
7 ossl_cmp_X509_STORE_add1_certs,
8 ossl_cmp_X509_STORE_get1_certs
9 - functions manipulating lists of certificates
10
11 =head1 SYNOPSIS
12
13   #include <openssl/cmp_util.h>
14
15   int ossl_cmp_sk_X509_add1_cert(STACK_OF(X509) *sk, X509 *cert,
16                                  int no_dup, int prepend);
17   int ossl_cmp_sk_X509_add1_certs(STACK_OF(X509) *sk, STACK_OF(X509) *certs,
18                                   int no_self_signed, int no_dups, int prepend);
19   int ossl_cmp_X509_STORE_add1_certs(X509_STORE *store, STACK_OF(X509) *certs,
20                                      int only_self_signed);
21   STACK_OF(X509) *ossl_cmp_X509_STORE_get1_certs(X509_STORE *store);
22
23 =head1 DESCRIPTION
24
25 ossl_cmp_sk_X509_add1_cert() appends or prepends (depending on the I<prepend>
26 argument) a certificate to the given list,
27 optionally only if it is not already contained.
28 On success the reference count of the certificate is increased.
29
30 ossl_cmp_sk_X509_add1_certs() appends or prepends (depending on the I<prepend>
31 argument) a list of certificates to the given list,
32 optionally only if not self-signed and optionally only if not already contained.
33 The reference counts of those certificates appended successfully are increased.
34
35 ossl_cmp_X509_STORE_add1_certs() adds all or only self-signed certificates from
36 the given stack to given store. The I<certs> parameter may be NULL.
37
38 ossl_cmp_X509_STORE_get1_certs() retrieves a copy of all certificates in the
39 given store.
40
41 =head1 RETURN VALUES
42
43 ossl_cmp_X509_STORE_get1_certs() returns a list of certificates, NULL on error.
44
45 All other functions return 1 on success, 0 on error.
46
47 =head1 HISTORY
48
49 The OpenSSL CMP support was added in OpenSSL 3.0.
50
51 =head1 COPYRIGHT
52
53 Copyright 2007-2020 The OpenSSL Project Authors. All Rights Reserved.
54
55 Licensed under the Apache License 2.0 (the "License").  You may not use
56 this file except in compliance with the License.  You can obtain a copy
57 in the file LICENSE in the source distribution or at
58 L<https://www.openssl.org/source/license.html>.
59
60 =cut