1=pod
2
3=head1 NAME
4
5X509_NAME_ENTRY_get_object, X509_NAME_ENTRY_get_data,
6X509_NAME_ENTRY_set_object, X509_NAME_ENTRY_set_data,
7X509_NAME_ENTRY_create_by_txt, X509_NAME_ENTRY_create_by_NID,
8X509_NAME_ENTRY_create_by_OBJ - X509_NAME_ENTRY utility functions
9
10=head1 SYNOPSIS
11
12 #include <openssl/x509.h>
13
14 ASN1_OBJECT *X509_NAME_ENTRY_get_object(const X509_NAME_ENTRY *ne);
15 ASN1_STRING *X509_NAME_ENTRY_get_data(const X509_NAME_ENTRY *ne);
16
17 int X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne, const ASN1_OBJECT *obj);
18 int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type,
19                              const unsigned char *bytes, int len);
20
21 X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne, const char *field,
22                                                int type, const unsigned char *bytes,
23                                                int len);
24 X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid,
25                                                int type, const unsigned char *bytes,
26                                                int len);
27 X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne,
28                                                const ASN1_OBJECT *obj, int type,
29                                                const unsigned char *bytes, int len);
30
31=head1 DESCRIPTION
32
33X509_NAME_ENTRY_get_object() retrieves the field name of B<ne> in
34and B<ASN1_OBJECT> structure.
35
36X509_NAME_ENTRY_get_data() retrieves the field value of B<ne> in
37and B<ASN1_STRING> structure.
38
39X509_NAME_ENTRY_set_object() sets the field name of B<ne> to B<obj>.
40
41X509_NAME_ENTRY_set_data() sets the field value of B<ne> to string type
42B<type> and value determined by B<bytes> and B<len>.
43
44X509_NAME_ENTRY_create_by_txt(), X509_NAME_ENTRY_create_by_NID()
45and X509_NAME_ENTRY_create_by_OBJ() create and return an
46B<X509_NAME_ENTRY> structure.
47
48=head1 NOTES
49
50X509_NAME_ENTRY_get_object() and X509_NAME_ENTRY_get_data() can be
51used to examine an B<X509_NAME_ENTRY> function as returned by
52X509_NAME_get_entry() for example.
53
54X509_NAME_ENTRY_create_by_txt(), X509_NAME_ENTRY_create_by_NID(),
55and X509_NAME_ENTRY_create_by_OBJ() create and return an
56
57X509_NAME_ENTRY_create_by_txt(), X509_NAME_ENTRY_create_by_OBJ(),
58X509_NAME_ENTRY_create_by_NID() and X509_NAME_ENTRY_set_data()
59are seldom used in practice because B<X509_NAME_ENTRY> structures
60are almost always part of B<X509_NAME> structures and the
61corresponding B<X509_NAME> functions are typically used to
62create and add new entries in a single operation.
63
64The arguments of these functions support similar options to the similarly
65named ones of the corresponding B<X509_NAME> functions such as
66X509_NAME_add_entry_by_txt(). So for example B<type> can be set to
67B<MBSTRING_ASC> but in the case of X509_set_data() the field name must be
68set first so the relevant field information can be looked up internally.
69
70=head1 RETURN VALUES
71
72X509_NAME_ENTRY_get_object() returns a valid B<ASN1_OBJECT> structure if it is
73set or NULL if an error occurred.
74
75X509_NAME_ENTRY_get_data() returns a valid B<ASN1_STRING> structure if it is set
76or NULL if an error occurred.
77
78X509_NAME_ENTRY_set_object() and X509_NAME_ENTRY_set_data() return 1 on success
79or 0 on error.
80
81X509_NAME_ENTRY_create_by_txt(), X509_NAME_ENTRY_create_by_NID() and
82X509_NAME_ENTRY_create_by_OBJ() return a valid B<X509_NAME_ENTRY> on success or
83NULL if an error occurred.
84
85=head1 SEE ALSO
86
87L<ERR_get_error(3)>, L<d2i_X509_NAME(3)>,
88L<OBJ_nid2obj(3)>
89
90=head1 COPYRIGHT
91
92Copyright 2002-2018 The OpenSSL Project Authors. All Rights Reserved.
93
94Licensed under the OpenSSL license (the "License").  You may not use
95this file except in compliance with the License.  You can obtain a copy
96in the file LICENSE in the source distribution or at
97L<https://www.openssl.org/source/license.html>.
98
99=cut
100