3 X509_EXTENSION_set_object, X509_EXTENSION_set_critical,
4 X509_EXTENSION_set_data, X509_EXTENSION_create_by_NID,
5 X509_EXTENSION_create_by_OBJ, X509_EXTENSION_get_object,
6 X509_EXTENSION_get_critical, X509_EXTENSION_get_data - extension utility
11 int X509_EXTENSION_set_object(X509_EXTENSION *ex, ASN1_OBJECT *obj);
12 int X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit);
13 int X509_EXTENSION_set_data(X509_EXTENSION *ex, ASN1_OCTET_STRING *data);
15 X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex,
17 ASN1_OCTET_STRING *data);
18 X509_EXTENSION *X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex,
19 ASN1_OBJECT *obj, int crit,
20 ASN1_OCTET_STRING *data);
22 ASN1_OBJECT *X509_EXTENSION_get_object(X509_EXTENSION *ex);
23 int X509_EXTENSION_get_critical(X509_EXTENSION *ex);
24 ASN1_OCTET_STRING *X509_EXTENSION_get_data(X509_EXTENSION *ne);
28 X509_EXTENSION_set_object() sets the extension type of B<ex> to B<obj>. The
29 B<obj> pointer is duplicated internally so B<obj> should be freed up after use.
31 X509_EXTENSION_set_critical() sets the criticality of B<ex> to B<crit>. If
32 B<crit> is zero the extension in non-critical otherwise it is critical.
34 X509_EXTENSION_set_data() sets the data in extension B<ex> to B<data>. The
35 B<data> pointer is duplicated internally.
37 X509_EXTENSION_create_by_NID() creates an extension of type B<nid>,
38 criticality B<crit> using data B<data>. The created extension is returned and
39 written to B<*ex> reusing or allocating a new extension if necessary so B<*ex>
40 should either be B<NULL> or a valid B<X509_EXTENSION> structure it must
41 B<not> be an uninitialised pointer.
43 X509_EXTENSION_create_by_OBJ() is identical to X509_EXTENSION_create_by_NID()
44 except it creates and extension using B<obj> instead of a NID.
46 X509_EXTENSION_get_object() returns the extension type of B<ex> as an
47 B<ASN1_OBJECT> pointer. The returned pointer is an internal value which must
50 X509_EXTENSION_get_critical() returns the criticality of extension B<ex> it
51 returns B<1> for critical and B<0> for non-critical.
53 X509_EXTENSION_get_data() returns the data of extension B<ex>. The returned
54 pointer is an internal value which must not be freed up.
58 These functions manipulate the contents of an extension directly. Most
59 applications will want to parse or encode and add an extension: they should
60 use the extension encode and decode functions instead such as
61 X509_add1_ext_i2d() and X509_get_ext_d2i().
63 The B<data> associated with an extension is the extension encoding in an
64 B<ASN1_OCTET_STRING> structure.
68 X509_EXTENSION_set_object() X509_EXTENSION_set_critical() and
69 X509_EXTENSION_set_data() return B<1> for success and B<0> for failure.
71 X509_EXTENSION_create_by_NID() and X509_EXTENSION_create_by_OBJ() return
72 an B<X509_EXTENSION> pointer or B<NULL> if an error occurs.
74 X509_EXTENSION_get_object() returns an B<ASN1_OBJECT> pointer.
76 X509_EXTENSION_get_critical() returns B<0> for non-critical and B<1> for
79 X509_EXTENSION_get_data() returns an B<ASN1_OCTET_STRING> pointer.