1X509_EXTENSION_SET_OBJECT(3) OpenSSL X509_EXTENSION_SET_OBJECT(3)
2
3
4
6 X509_EXTENSION_set_object, X509_EXTENSION_set_critical,
7 X509_EXTENSION_set_data, X509_EXTENSION_create_by_NID,
8 X509_EXTENSION_create_by_OBJ, X509_EXTENSION_get_object,
9 X509_EXTENSION_get_critical, X509_EXTENSION_get_data - extension
10 utility functions
11
13 int X509_EXTENSION_set_object(X509_EXTENSION *ex, const ASN1_OBJECT *obj);
14 int X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit);
15 int X509_EXTENSION_set_data(X509_EXTENSION *ex, ASN1_OCTET_STRING *data);
16
17 X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex,
18 int nid, int crit,
19 ASN1_OCTET_STRING *data);
20 X509_EXTENSION *X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex,
21 const ASN1_OBJECT *obj, int crit,
22 ASN1_OCTET_STRING *data);
23
24 ASN1_OBJECT *X509_EXTENSION_get_object(X509_EXTENSION *ex);
25 int X509_EXTENSION_get_critical(const X509_EXTENSION *ex);
26 ASN1_OCTET_STRING *X509_EXTENSION_get_data(X509_EXTENSION *ne);
27
29 X509_EXTENSION_set_object() sets the extension type of ex to obj. The
30 obj pointer is duplicated internally so obj should be freed up after
31 use.
32
33 X509_EXTENSION_set_critical() sets the criticality of ex to crit. If
34 crit is zero the extension in non-critical otherwise it is critical.
35
36 X509_EXTENSION_set_data() sets the data in extension ex to data. The
37 data pointer is duplicated internally.
38
39 X509_EXTENSION_create_by_NID() creates an extension of type nid,
40 criticality crit using data data. The created extension is returned and
41 written to *ex reusing or allocating a new extension if necessary so
42 *ex should either be NULL or a valid X509_EXTENSION structure it must
43 not be an uninitialised pointer.
44
45 X509_EXTENSION_create_by_OBJ() is identical to
46 X509_EXTENSION_create_by_NID() except it creates and extension using
47 obj instead of a NID.
48
49 X509_EXTENSION_get_object() returns the extension type of ex as an
50 ASN1_OBJECT pointer. The returned pointer is an internal value which
51 must not be freed up.
52
53 X509_EXTENSION_get_critical() returns the criticality of extension ex
54 it returns 1 for critical and 0 for non-critical.
55
56 X509_EXTENSION_get_data() returns the data of extension ex. The
57 returned pointer is an internal value which must not be freed up.
58
60 These functions manipulate the contents of an extension directly. Most
61 applications will want to parse or encode and add an extension: they
62 should use the extension encode and decode functions instead such as
63 X509_add1_ext_i2d() and X509_get_ext_d2i().
64
65 The data associated with an extension is the extension encoding in an
66 ASN1_OCTET_STRING structure.
67
69 X509_EXTENSION_set_object() X509_EXTENSION_set_critical() and
70 X509_EXTENSION_set_data() return 1 for success and 0 for failure.
71
72 X509_EXTENSION_create_by_NID() and X509_EXTENSION_create_by_OBJ()
73 return an X509_EXTENSION pointer or NULL if an error occurs.
74
75 X509_EXTENSION_get_object() returns an ASN1_OBJECT pointer.
76
77 X509_EXTENSION_get_critical() returns 0 for non-critical and 1 for
78 critical.
79
80 X509_EXTENSION_get_data() returns an ASN1_OCTET_STRING pointer.
81
83 X509V3_get_d2i(3)
84
86 Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
87
88 Licensed under the OpenSSL license (the "License"). You may not use
89 this file except in compliance with the License. You can obtain a copy
90 in the file LICENSE in the source distribution or at
91 <https://www.openssl.org/source/license.html>.
92
93
94
951.1.1q 2023-02-06 X509_EXTENSION_SET_OBJECT(3)