Unleashed v1.4
[unleashed.git] / lib / libcrypto / man / X509_NAME_new.3
blob527e22272c2db6ad9cebcd5cff7c64cd793ab5f7
1 .\"     $OpenBSD: X509_NAME_new.3,v 1.6 2018/07/29 20:29:32 tb 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 29 2018 $
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
34 An X.501
35 .Vt Name
36 is an ordered sequence of relative distinguished names.
37 A relative distinguished name is a set of key-value pairs; see
38 .Xr X509_NAME_ENTRY_new 3
39 for details.
40 .Pp
41 Various X.509 structures contain X.501
42 .Vt Name
43 substructures.
44 They are for example used for the issuers of certificates and
45 certificate revocation lists and for the subjects of certificates
46 and certificate requests.
47 .Pp
48 .Fn X509_NAME_new
49 allocates and initializes an empty
50 .Vt X509_NAME
51 object, representing an ASN.1
52 .Vt Name
53 structure defined in RFC 5280 section 4.1.2.4.
54 Data can be added to such objects with the functions described in
55 .Xr X509_NAME_add_entry_by_txt 3 ,
56 and 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
60 frees
61 .Fa name
62 and all the
63 .Vt X509_NAME_ENTRY
64 objects contained in it.
66 .Fa name
67 is a
68 .Dv NULL
69 pointer, no action occurs.
70 .Sh RETURN VALUES
71 .Fn X509_NAME_new
72 returns a new
73 .Vt X509_NAME
74 object or
75 .Dv NULL
76 if 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_ENTRY_new 3 ,
85 .Xr X509_NAME_get_index_by_NID 3 ,
86 .Xr X509_NAME_print_ex 3
87 .Sh STANDARDS
88 RFC 5280: Internet X.509 Public Key Infrastructure Certificate and
89 Certificate Revocation List (CRL) Profile
90 .Pp
91 ITU-T Recommendation X.501, also known as ISO/IEC 9594-2:
92 Information Technology \(en Open Systems Interconnection \(en
93 The Directory: Models, section 9: Names
94 .Sh HISTORY
95 .Fn X509_NAME_new
96 and
97 .Fn X509_NAME_free
98 appeared in SSLeay 0.4 or earlier and have been available since
99 .Ox 2.4 .