1.\" $OpenBSD: NAME_CONSTRAINTS_new.3,v 1.4 2020/09/17 08:50:05 schwarze Exp $ 2.\" 3.\" Copyright (c) 2016 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: September 17 2020 $ 18.Dt NAME_CONSTRAINTS_NEW 3 19.Os 20.Sh NAME 21.Nm NAME_CONSTRAINTS_new , 22.Nm NAME_CONSTRAINTS_free , 23.Nm GENERAL_SUBTREE_new , 24.Nm GENERAL_SUBTREE_free 25.\" .Nm NAME_CONSTRAINTS_check is intentionally undocumented. 26.\" beck@ said in the x509/x509_ncons.c rev. 1.4 commit message: 27.\" We probably need to deprecate it thoughtfully. 28.Nd X.509 CA name constraints extension 29.Sh SYNOPSIS 30.In openssl/x509v3.h 31.Ft NAME_CONSTRAINTS * 32.Fn NAME_CONSTRAINTS_new void 33.Ft void 34.Fn NAME_CONSTRAINTS_free "NAME_CONSTRAINTS *names" 35.Ft GENERAL_SUBTREE * 36.Fn GENERAL_SUBTREE_new void 37.Ft void 38.Fn GENERAL_SUBTREE_free "GENERAL_SUBTREE *name" 39.Sh DESCRIPTION 40X.509 CA certificates can use the name constraints extension 41to restrict the subject names of subsequent certificates in a 42certification path. 43.Pp 44.Fn NAME_CONSTRAINTS_new 45allocates and initializes an empty 46.Vt NAME_CONSTRAINTS 47object, representing an ASN.1 48.Vt NameConstraints 49structure defined in RFC 5280 section 4.2.1.10. 50It consists of two 51.Vt STACK_OF(GENERAL_SUBTREE) 52objects, one specifying permitted names, the other excluded names. 53.Fn NAME_CONSTRAINTS_free 54frees 55.Fa names . 56.Pp 57.Fn GENERAL_SUBTREE_new 58allocates and initializes an empty 59.Vt GENERAL_SUBTREE 60object, representing an ASN.1 61.Vt GeneralSubtree 62structure defined in RFC 5280 section 4.2.1.10. 63It is a trivial wrapper around the 64.Vt GENERAL_NAME 65object documented in 66.Xr GENERAL_NAME_new 3 . 67The standard requires the other fields of 68.Vt GENERAL_SUBTREE 69to be ignored. 70.Fn GENERAL_SUBTREE_free 71frees 72.Fa name . 73.Sh RETURN VALUES 74.Fn NAME_CONSTRAINTS_new 75and 76.Fn GENERAL_SUBTREE_new 77return the new 78.Vt NAME_CONSTRAINTS 79or 80.Vt GENERAL_SUBTREE 81object, respectively, or 82.Dv NULL 83if an error occurs. 84.Sh SEE ALSO 85.Xr BASIC_CONSTRAINTS_new 3 , 86.Xr GENERAL_NAMES_new 3 , 87.Xr X509_EXTENSION_new 3 , 88.Xr X509_new 3 89.Sh STANDARDS 90RFC 5280: Internet X.509 Public Key Infrastructure Certificate and 91Certificate Revocation List (CRL) Profile, 92section 4.2.1.10: Name Constraints 93.Sh HISTORY 94.Fn NAME_CONSTRAINTS_new , 95.Fn NAME_CONSTRAINTS_free , 96.Fn GENERAL_SUBTREE_new , 97and 98.Fn GENERAL_SUBTREE_free 99first appeared in OpenSSL 0.9.8 and have been available since 100.Ox 4.5 . 101