1 .\" $OpenBSD: X509_NAME_ENTRY_get_object.3,v 1.6 2016/12/25 22:15:10 schwarze Exp $
2 .\" OpenSSL aebb9aac Jul 19 09:27:53 2016 -0400
4 .\" This file is a derived work.
5 .\" The changes are covered by the following Copyright and license:
7 .\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
9 .\" Permission to use, copy, modify, and distribute this software for any
10 .\" purpose with or without fee is hereby granted, provided that the above
11 .\" copyright notice and this permission notice appear in all copies.
13 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
14 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
16 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
19 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21 .\" The original file was written by Dr. Stephen Henson <steve@openssl.org>.
22 .\" Copyright (c) 2002, 2005, 2006 The OpenSSL Project. All rights reserved.
24 .\" Redistribution and use in source and binary forms, with or without
25 .\" modification, are permitted provided that the following conditions
28 .\" 1. Redistributions of source code must retain the above copyright
29 .\" notice, this list of conditions and the following disclaimer.
31 .\" 2. Redistributions in binary form must reproduce the above copyright
32 .\" notice, this list of conditions and the following disclaimer in
33 .\" the documentation and/or other materials provided with the
36 .\" 3. All advertising materials mentioning features or use of this
37 .\" software must display the following acknowledgment:
38 .\" "This product includes software developed by the OpenSSL Project
39 .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
41 .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
42 .\" endorse or promote products derived from this software without
43 .\" prior written permission. For written permission, please contact
44 .\" openssl-core@openssl.org.
46 .\" 5. Products derived from this software may not be called "OpenSSL"
47 .\" nor may "OpenSSL" appear in their names without prior written
48 .\" permission of the OpenSSL Project.
50 .\" 6. Redistributions of any form whatsoever must retain the following
52 .\" "This product includes software developed by the OpenSSL Project
53 .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
55 .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
56 .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
57 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
58 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
59 .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
60 .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
61 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
62 .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
63 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
64 .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
65 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
66 .\" OF THE POSSIBILITY OF SUCH DAMAGE.
68 .Dd $Mdocdate: December 25 2016 $
69 .Dt X509_NAME_ENTRY_GET_OBJECT 3
72 .Nm X509_NAME_ENTRY_new ,
73 .Nm X509_NAME_ENTRY_free ,
74 .Nm X509_NAME_ENTRY_get_object ,
75 .Nm X509_NAME_ENTRY_get_data ,
76 .Nm X509_NAME_ENTRY_set_object ,
77 .Nm X509_NAME_ENTRY_set_data ,
78 .Nm X509_NAME_ENTRY_create_by_txt ,
79 .Nm X509_NAME_ENTRY_create_by_NID ,
80 .Nm X509_NAME_ENTRY_create_by_OBJ
81 .\" In the following line, "X.501" is not a typo.
82 .\" This object defined in X.501, not in X.509.
83 .Nd X.501 relative distinguished name
87 .Fn X509_NAME_ENTRY_new void
89 .Fo X509_NAME_ENTRY_free
90 .Fa "X509_NAME_ENTRY* ne"
93 .Fo X509_NAME_ENTRY_get_object
94 .Fa "X509_NAME_ENTRY *ne"
97 .Fo X509_NAME_ENTRY_get_data
98 .Fa "X509_NAME_ENTRY *ne"
101 .Fo X509_NAME_ENTRY_set_object
102 .Fa "X509_NAME_ENTRY *ne"
103 .Fa "ASN1_OBJECT *obj"
106 .Fo X509_NAME_ENTRY_set_data
107 .Fa "X509_NAME_ENTRY *ne"
109 .Fa "const unsigned char *bytes"
112 .Ft X509_NAME_ENTRY *
113 .Fo X509_NAME_ENTRY_create_by_txt
114 .Fa "X509_NAME_ENTRY **ne"
115 .Fa "const char *field"
117 .Fa "const unsigned char *bytes"
120 .Ft X509_NAME_ENTRY *
121 .Fo X509_NAME_ENTRY_create_by_NID
122 .Fa "X509_NAME_ENTRY **ne"
125 .Fa "unsigned char *bytes"
128 .Ft X509_NAME_ENTRY *
129 .Fo X509_NAME_ENTRY_create_by_OBJ
130 .Fa "X509_NAME_ENTRY **ne"
131 .Fa "ASN1_OBJECT *obj"
133 .Fa "const unsigned char *bytes"
138 .Vt RelativeDistinguishedName
139 is a set of field type and value pairs.
140 It is the building block for constructing X.501
143 This implementation only supports sets with one element, so an
145 object contains only one field type and one value.
147 .Fn X509_NAME_ENTRY_new
148 allocates and initializes an empty
150 object, representing an ASN.1
151 .Vt RelativeDistinguishedName
152 structure defined in RFC 5280 section 4.1.2.4.
154 .Fn X509_NAME_ENTRY_free
157 and the type and value contained in it.
159 .Fn X509_NAME_ENTRY_get_object
160 retrieves the field type of
165 .Fn X509_NAME_ENTRY_get_data
166 retrieves the field value of
171 These two functions can be used to examine an
173 object as returned by
174 .Xr X509_NAME_get_entry 3 .
176 .Fn X509_NAME_ENTRY_set_object
177 sets the field type of
182 .Fn X509_NAME_ENTRY_set_data
183 sets the field value of
187 and the value determined by
192 .Fn X509_NAME_ENTRY_create_by_txt ,
193 .Fn X509_NAME_ENTRY_create_by_NID ,
195 .Fn X509_NAME_ENTRY_create_by_OBJ
201 .Fn X509_NAME_ENTRY_get_object
203 .Fn X509_NAME_ENTRY_get_data ,
204 these functions are rarely used because
206 structures are almost always part of
208 structures and the functions described in
209 .Xr X509_NAME_add_entry_by_txt 3
210 are typically used to create and add new entries in a single operation.
212 The arguments of these functions support similar options to the
213 similarly named ones described in
214 .Xr X509_NAME_add_entry_by_txt 3 .
220 .Fn X509_NAME_ENTRY_set_data
221 the field type must be set first so the relevant field information
222 can be looked up internally.
224 .Xr ERR_get_error 3 ,
226 .Xr X509_NAME_add_entry 3 ,
227 .Xr X509_NAME_get_entry 3 ,
230 RFC 5280: Internet X.509 Public Key Infrastructure Certificate and
231 Certificate Revocation List (CRL) Profile
233 ITU-T Recommendation X.501, also known as ISO/IEC 9594-2: Information
234 Technology Open Systems Interconnection The Directory: Models,
235 section 9.3: Relative distinguished name