1.\" $OpenBSD: X509_CRL_new.3,v 1.13 2021/10/30 16:20:35 schwarze 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: October 30 2021 $ 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 . 70If 71.Xr X509_CRL_set_default_method 3 72was in effect at the time 73.Fa crl 74was created and the 75.Fn crl_free 76callback is not 77.Dv NULL , 78that callback is invoked near the end of 79.Fn X509_CRL_free , 80right before freeing 81.Fa crl 82itself. 83.Pp 84.Fn X509_CRL_INFO_new 85allocates and initializes an empty 86.Vt X509_CRL_INFO 87object, representing an ASN.1 88.Vt TBSCertList 89structure defined in RFC 5280 section 5.1. 90It is used inside the 91.Vt X509_CRL 92object and can hold a list of revoked certificates, an issuer name, 93the time the list was issued, the time when the next update of the 94list is due, and optional extensions. 95.Fn X509_CRL_INFO_free 96frees 97.Fa crl_info . 98.Sh RETURN VALUES 99.Fn X509_CRL_new , 100.Fn X509_CRL_dup , 101and 102.Fn X509_CRL_INFO_new 103return the new 104.Vt X509_CRL 105or 106.Vt X509_CRL_INFO 107object, respectively, or 108.Dv NULL 109if an error occurs. 110.Pp 111.Fn X509_CRL_up_ref 112returns 1 on success or 0 on error. 113.Sh SEE ALSO 114.Xr ACCESS_DESCRIPTION_new 3 , 115.Xr AUTHORITY_KEYID_new 3 , 116.Xr d2i_X509_CRL 3 , 117.Xr DIST_POINT_new 3 , 118.Xr PEM_read_X509_CRL 3 , 119.Xr X509_CRL_digest 3 , 120.Xr X509_CRL_get0_by_serial 3 , 121.Xr X509_CRL_get0_lastUpdate 3 , 122.Xr X509_CRL_get0_signature 3 , 123.Xr X509_CRL_get_ext 3 , 124.Xr X509_CRL_get_ext_d2i 3 , 125.Xr X509_CRL_get_issuer 3 , 126.Xr X509_CRL_get_version 3 , 127.Xr X509_CRL_match 3 , 128.Xr X509_CRL_METHOD_new 3 , 129.Xr X509_CRL_print 3 , 130.Xr X509_CRL_sign 3 , 131.Xr X509_EXTENSION_new 3 , 132.Xr X509_INFO_new 3 , 133.Xr X509_load_crl_file 3 , 134.Xr X509_new 3 , 135.Xr X509_OBJECT_get0_X509_CRL 3 , 136.Xr X509_REVOKED_new 3 , 137.Xr X509_STORE_CTX_set0_crls 3 , 138.Xr X509_STORE_get1_crls 3 139.Sh STANDARDS 140RFC 5280: Internet X.509 Public Key Infrastructure Certificate and 141Certificate Revocation List (CRL) Profile, section 5: CRL and CRL 142Extensions Profile 143.Sh HISTORY 144.Fn X509_CRL_new , 145.Fn X509_CRL_free , 146.Fn X509_CRL_INFO_new , 147and 148.Fn X509_CRL_INFO_free 149first appeared in SSLeay 0.4.4. 150.Fn X509_CRL_dup 151first appeared in SSLeay 0.5.1. 152These functions have been available since 153.Ox 2.4 . 154.Pp 155.Fn X509_CRL_up_ref 156first appeared in OpenSSL 1.1.0 and has been available since 157.Ox 6.3 . 158