xref: /openbsd/lib/libcrypto/man/X509_NAME_new.3 (revision d415bd75)
1.\" $OpenBSD: X509_NAME_new.3,v 1.9 2021/07/20 17:31:32 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: July 20 2021 $
18.Dt X509_NAME_NEW 3
19.Os
20.Sh NAME
21.Nm X509_NAME_new ,
22.Nm X509_NAME_free
23.\" In the following line, "X.501" and "Name" are not typos.
24.\" The "Name" type is defined in X.501, not in X.509.
25.\" The type in called "Name" with capital "N", not "name".
26.Nd X.501 Name object
27.Sh SYNOPSIS
28.In openssl/x509.h
29.Ft X509_NAME *
30.Fn X509_NAME_new void
31.Ft void
32.Fn X509_NAME_free "X509_NAME *name"
33.Sh DESCRIPTION
34An X.501
35.Vt Name
36is an ordered sequence of relative distinguished names.
37A relative distinguished name is a set of key-value pairs; see
38.Xr X509_NAME_ENTRY_new 3
39for details.
40.Pp
41Various X.509 structures contain X.501
42.Vt Name
43substructures.
44They are for example used for the issuers of certificates and
45certificate revocation lists and for the subjects of certificates
46and certificate requests.
47.Pp
48.Fn X509_NAME_new
49allocates and initializes an empty
50.Vt X509_NAME
51object, representing an ASN.1
52.Vt Name
53structure defined in RFC 5280 section 4.1.2.4.
54Data can be added to such objects with the functions described in
55.Xr X509_NAME_add_entry_by_txt 3 ,
56and they can be inspected with the functions described in
57.Xr X509_NAME_get_index_by_NID 3 .
58.Pp
59.Fn X509_NAME_free
60frees
61.Fa name
62and all the
63.Vt X509_NAME_ENTRY
64objects contained in it.
65If
66.Fa name
67is a
68.Dv NULL
69pointer, no action occurs.
70.Sh RETURN VALUES
71.Fn X509_NAME_new
72returns a new
73.Vt X509_NAME
74object or
75.Dv NULL
76if an error occurred.
77.Sh SEE ALSO
78.Xr d2i_X509_NAME 3 ,
79.Xr GENERAL_NAME_new 3 ,
80.Xr NAME_CONSTRAINTS_new 3 ,
81.Xr SSL_load_client_CA_file 3 ,
82.Xr X509_get_subject_name 3 ,
83.Xr X509_NAME_add_entry_by_txt 3 ,
84.Xr X509_NAME_cmp 3 ,
85.Xr X509_NAME_digest 3 ,
86.Xr X509_NAME_ENTRY_new 3 ,
87.Xr X509_NAME_get_index_by_NID 3 ,
88.Xr X509_NAME_hash 3 ,
89.Xr X509_NAME_print_ex 3 ,
90.Xr X509_new 3
91.Sh STANDARDS
92RFC 5280: Internet X.509 Public Key Infrastructure Certificate and
93Certificate Revocation List (CRL) Profile
94.Pp
95ITU-T Recommendation X.501, also known as ISO/IEC 9594-2:
96Information Technology \(en Open Systems Interconnection \(en
97The Directory: Models, section 9: Names
98.Sh HISTORY
99.Fn X509_NAME_new
100and
101.Fn X509_NAME_free
102appeared in SSLeay 0.4 or earlier and have been available since
103.Ox 2.4 .
104