1.\" $OpenBSD: X509_CRL_new.3,v 1.14 2024/03/06 02:34:14 tb Exp $ 2.\" 3.\" Copyright (c) 2016, 2018, 2021 Ingo Schwarze <schwarze@openbsd.org> 4.\" 5.\" Permission to use, copy, modify, and distribute this software for any 6.\" purpose with or without fee is hereby granted, provided that the above 7.\" copyright notice and this permission notice appear in all copies. 8.\" 9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16.\" 17.Dd $Mdocdate: March 6 2024 $ 18.Dt X509_CRL_NEW 3 19.Os 20.Sh NAME 21.Nm X509_CRL_new , 22.Nm X509_CRL_dup , 23.Nm X509_CRL_up_ref , 24.Nm X509_CRL_free , 25.Nm X509_CRL_INFO_new , 26.Nm X509_CRL_INFO_free 27.Nd X.509 certificate revocation lists 28.Sh SYNOPSIS 29.In openssl/x509.h 30.Ft X509_CRL * 31.Fn X509_CRL_new void 32.Ft X509_CRL * 33.Fn X509_CRL_dup "X509_CRL *crl" 34.Ft int 35.Fn X509_CRL_up_ref "X509_CRL *crl" 36.Ft void 37.Fn X509_CRL_free "X509_CRL *crl" 38.Ft X509_CRL_INFO * 39.Fn X509_CRL_INFO_new void 40.Ft void 41.Fn X509_CRL_INFO_free "X509_CRL_INFO *crl_info" 42.Sh DESCRIPTION 43.Fn X509_CRL_new 44allocates and initializes an empty 45.Vt X509_CRL 46object, representing an ASN.1 47.Vt CertificateList 48structure defined in RFC 5280 section 5.1. 49It can hold a pointer to an 50.Vt X509_CRL_INFO 51object discussed below together with a cryptographic signature 52and information about the signature algorithm used. 53The reference count is set to 1. 54.Pp 55.Fn X509_CRL_dup 56creates a deep copy of 57.Fa crl . 58.Pp 59.Fn X509_CRL_up_ref 60increments the reference count of 61.Fa crl 62by 1. 63.Pp 64.Fn X509_CRL_free 65decrements the reference count of 66.Fa crl 67by 1. 68If the reference count reaches 0, it frees 69.Fa crl . 70.Pp 71.Fn X509_CRL_INFO_new 72allocates and initializes an empty 73.Vt X509_CRL_INFO 74object, representing an ASN.1 75.Vt TBSCertList 76structure defined in RFC 5280 section 5.1. 77It is used inside the 78.Vt X509_CRL 79object and can hold a list of revoked certificates, an issuer name, 80the time the list was issued, the time when the next update of the 81list is due, and optional extensions. 82.Fn X509_CRL_INFO_free 83frees 84.Fa crl_info . 85.Sh RETURN VALUES 86.Fn X509_CRL_new , 87.Fn X509_CRL_dup , 88and 89.Fn X509_CRL_INFO_new 90return the new 91.Vt X509_CRL 92or 93.Vt X509_CRL_INFO 94object, respectively, or 95.Dv NULL 96if an error occurs. 97.Pp 98.Fn X509_CRL_up_ref 99returns 1 on success or 0 on error. 100.Sh SEE ALSO 101.Xr ACCESS_DESCRIPTION_new 3 , 102.Xr AUTHORITY_KEYID_new 3 , 103.Xr d2i_X509_CRL 3 , 104.Xr DIST_POINT_new 3 , 105.Xr PEM_read_X509_CRL 3 , 106.Xr X509_CRL_digest 3 , 107.Xr X509_CRL_get0_by_serial 3 , 108.Xr X509_CRL_get0_lastUpdate 3 , 109.Xr X509_CRL_get0_signature 3 , 110.Xr X509_CRL_get_ext 3 , 111.Xr X509_CRL_get_ext_d2i 3 , 112.Xr X509_CRL_get_issuer 3 , 113.Xr X509_CRL_get_version 3 , 114.Xr X509_CRL_match 3 , 115.Xr X509_CRL_print 3 , 116.Xr X509_CRL_sign 3 , 117.Xr X509_EXTENSION_new 3 , 118.Xr X509_INFO_new 3 , 119.Xr X509_load_crl_file 3 , 120.Xr X509_new 3 , 121.Xr X509_OBJECT_get0_X509_CRL 3 , 122.Xr X509_REVOKED_new 3 , 123.Xr X509_STORE_CTX_set0_crls 3 , 124.Xr X509_STORE_get1_crls 3 125.Sh STANDARDS 126RFC 5280: Internet X.509 Public Key Infrastructure Certificate and 127Certificate Revocation List (CRL) Profile, section 5: CRL and CRL 128Extensions Profile 129.Sh HISTORY 130.Fn X509_CRL_new , 131.Fn X509_CRL_free , 132.Fn X509_CRL_INFO_new , 133and 134.Fn X509_CRL_INFO_free 135first appeared in SSLeay 0.4.4. 136.Fn X509_CRL_dup 137first appeared in SSLeay 0.5.1. 138These functions have been available since 139.Ox 2.4 . 140.Pp 141.Fn X509_CRL_up_ref 142first appeared in OpenSSL 1.1.0 and has been available since 143.Ox 6.3 . 144