1.\" $OpenBSD: X509_STORE_set1_param.3,v 1.6 2018/02/25 22:52:48 schwarze Exp $ 2.\" content checked up to: 3.\" OpenSSL man3/X509_STORE_get0_param e90fc053 Jul 15 09:39:45 2017 -0400 4.\" 5.\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org> 6.\" 7.\" Permission to use, copy, modify, and distribute this software for any 8.\" purpose with or without fee is hereby granted, provided that the above 9.\" copyright notice and this permission notice appear in all copies. 10.\" 11.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 12.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 13.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 14.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 15.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 16.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 17.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18.\" 19.Dd $Mdocdate: February 25 2018 $ 20.Dt X509_STORE_SET1_PARAM 3 21.Os 22.Sh NAME 23.Nm X509_STORE_set1_param , 24.Nm X509_STORE_set_flags , 25.Nm X509_STORE_set_purpose , 26.Nm X509_STORE_set_trust , 27.Nm X509_STORE_set_depth , 28.Nm X509_STORE_add_cert , 29.Nm X509_STORE_add_crl , 30.Nm X509_STORE_get0_objects , 31.Nm X509_STORE_set_ex_data , 32.Nm X509_STORE_get_ex_data 33.Nd get and set X509_STORE data 34.Sh SYNOPSIS 35.In openssl/x509_vfy.h 36.Ft int 37.Fo X509_STORE_set1_param 38.Fa "X509_STORE *store" 39.Fa "X509_VERIFY_PARAM *pm" 40.Fc 41.Ft int 42.Fo X509_STORE_set_flags 43.Fa "X509_STORE *store" 44.Fa "unsigned long flags" 45.Fc 46.Ft int 47.Fo X509_STORE_set_purpose 48.Fa "X509_STORE *store" 49.Fa "int purpose" 50.Fc 51.Ft int 52.Fo X509_STORE_set_trust 53.Fa "X509_STORE *store" 54.Fa "int trust" 55.Fc 56.Ft int 57.Fo X509_STORE_set_depth 58.Fa "X509_STORE *store" 59.Fa "int depth" 60.Fc 61.Ft int 62.Fo X509_STORE_add_cert 63.Fa "X509_STORE *store" 64.Fa "X509 *x" 65.Fc 66.Ft int 67.Fo X509_STORE_add_crl 68.Fa "X509_STORE *store" 69.Fa "X509_CRL *crl" 70.Fc 71.Ft STACK_OF(X509_OBJECT) * 72.Fo X509_STORE_get0_objects 73.Fa "X509_STORE *store" 74.Fc 75.Ft int 76.Fo X509_STORE_set_ex_data 77.Fa "X509_STORE *store" 78.Fa "int idx" 79.Fa "void *arg" 80.Fc 81.Ft void * 82.Fo X509_STORE_get_ex_data 83.Fa "X509_STORE *store" 84.Fa "int idx" 85.Fc 86.Sh DESCRIPTION 87.Fn X509_STORE_set1_param 88copies the verification parameters from 89.Fa pm 90into the verification parameter object contained in the 91.Fa store . 92.Pp 93.Fn X509_VERIFY_PARAM_set_flags , 94.Fn X509_STORE_set_purpose , 95.Fn X509_STORE_set_trust , 96and 97.Fn X509_STORE_set_depth 98call 99.Fn X509_VERIFY_PARAM_set_flags , 100.Fn X509_VERIFY_PARAM_set_purpose , 101.Fn X509_VERIFY_PARAM_set_trust , 102and 103.Fn X509_VERIFY_PARAM_set_depth 104on the verification parameter object contained in the 105.Fa store . 106.Pp 107.Fn X509_STORE_add_cert 108and 109.Fn X509_STORE_add_crl 110add the certificate 111.Fa x 112or the certificate revocation list 113.Fa crl 114to the 115.Fa store , 116increasing its reference count by 1 in case of success. 117.Pp 118.Fn X509_STORE_set_ex_data 119and 120.Fn X509_STORE_get_ex_data 121handle application specific data in 122.Vt X509_STORE 123objects. 124Their usage is identical to that of 125.Xr RSA_set_ex_data 3 126and 127.Xr RSA_get_ex_data 3 . 128.Sh RETURN VALUES 129.Fn X509_STORE_set1_param , 130.Fn X509_STORE_set_purpose , 131.Fn X509_STORE_set_trust , 132and 133.Fn X509_STORE_set_ex_data 134return 1 for success or 0 for failure. 135.Pp 136.Fn X509_STORE_set_flags 137and 138.Fn X509_STORE_set_depth 139always return 1, indicating success. 140.Pp 141.Fn X509_STORE_add_cert 142and 143.Fn X509_STORE_add_crl 144return 1 for success or 0 for failure. 145For example, they fail if 146.Fa x 147or 148.Fa crl 149is a 150.Dv NULL 151pointer, if a certificate with the same subject name as 152.Fa x 153or a revocation list with the same issuer name as 154.Fa crl 155are already contained in the 156.Fa store , 157or if memory allocation fails. 158.Pp 159.Fn X509_STORE_get0_objects 160returns an internal pointer to the stack of certificates, revocation lists, 161and private keys contained in the 162.Fa store . 163The returned pointer must not be freed by the calling application. 164.Pp 165.Fn X509_STORE_get_ex_data 166returns the application data or 167.Dv NULL 168on failure. 169.Sh SEE ALSO 170.Xr SSL_set1_param 3 , 171.Xr X509_OBJECT_get0_X509 3 , 172.Xr X509_STORE_CTX_set0_param 3 , 173.Xr X509_STORE_load_locations 3 , 174.Xr X509_STORE_new 3 , 175.Xr X509_VERIFY_PARAM_set_flags 3 176.Sh HISTORY 177.Fn X509_STORE_get0_objects 178first appeared in OpenSSL 1.1.0. 179