1X509_ADD_CERT(3ossl)                OpenSSL               X509_ADD_CERT(3ossl)
2
3
4

NAME

6       X509_add_cert, X509_add_certs - X509 certificate list addition
7       functions
8

SYNOPSIS

10        #include <openssl/x509.h>
11
12        int X509_add_cert(STACK_OF(X509) *sk, X509 *cert, int flags);
13        int X509_add_certs(STACK_OF(X509) *sk, STACK_OF(X509) *certs, int flags);
14

DESCRIPTION

16       X509_add_cert() adds a certificate cert to the given list sk.
17
18       X509_add_certs() adds a list of certificate certs to the given list sk.
19       The certs argument may be NULL, which implies no effect.  It does not
20       modify the list certs but in case the X509_ADD_FLAG_UP_REF flag
21       (described below) is set the reference counters of those of its members
22       added to sk are increased.
23
24       Both these functions have a flags parameter, which is used to control
25       details of the operation.
26
27       The value X509_ADD_FLAG_DEFAULT, which equals 0, means no special
28       semantics.
29
30       If X509_ADD_FLAG_UP_REF is set then the reference counts of those
31       certificates added successfully are increased.
32
33       If X509_ADD_FLAG_PREPEND is set then the certificates are prepended to
34       sk.  By default they are appended to sk.  In both cases the original
35       order of the added certificates is preserved.
36
37       If X509_ADD_FLAG_NO_DUP is set then certificates already contained in
38       sk, which is determined using X509_cmp(3), are ignored.
39
40       If X509_ADD_FLAG_NO_SS is set then certificates that are marked self-
41       signed, which is determined using X509_self_signed(3), are ignored.
42

RETURN VALUES

44       Both functions return 1 for success and 0 for failure.
45

NOTES

47       If X509_add_certs() is used with the flags X509_ADD_FLAG_NO_DUP or
48       X509_ADD_FLAG_NO_SS it is advisable to use also X509_ADD_FLAG_UP_REF
49       because otherwise likely not for all members of the certs list the
50       ownership is transferred to the list of certificates sk.
51
52       Care should also be taken in case the certs argument equals sk.
53

SEE ALSO

55       X509_cmp(3) X509_self_signed(3)
56

HISTORY

58       The functions X509_add_cert() and X509_add_certs() were added in
59       OpenSSL 3.0.
60
62       Copyright 2019-2022 The OpenSSL Project Authors. All Rights Reserved.
63
64       Licensed under the Apache License 2.0 (the "License").  You may not use
65       this file except in compliance with the License.  You can obtain a copy
66       in the file LICENSE in the source distribution or at
67       <https://www.openssl.org/source/license.html>.
68
69
70
713.1.1                             2023-08-31              X509_ADD_CERT(3ossl)
Impressum