Various DSA opacity fixups
[openssl.git] / doc / crypto / X509_EXTENSION_set_object.pod
1 =head1 NAME
2
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
7 functions.
8
9 =head1 SYNOPSIS
10
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);
14
15  X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex,
16                                               int nid, int crit,
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);
21
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);
25
26 =head1 DESCRIPTION
27
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.
30
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.
33
34 X509_EXTENSION_set_data() sets the data in extension B<ex> to B<data>. The
35 B<data> pointer is duplicated internally.
36
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.
42
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.
45
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
48 not be freed up.
49
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.
52
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.
55
56 =head1 NOTES
57
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().
62
63 The B<data> associated with an extension is the extension encoding in an
64 B<ASN1_OCTET_STRING> structure.
65
66 =head1 RETURN VALUES
67
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.
70
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.
73
74 X509_EXTENSION_get_object() returns an B<ASN1_OBJECT> pointer.
75
76 X509_EXTENSION_get_critical() returns B<0> for non-critical and B<1> for
77 critical.
78
79 X509_EXTENSION_get_data() returns an B<ASN1_OCTET_STRING> pointer.
80
81 =head1 SEE ALSO
82
83 L<X509V3_get_d2i(3)>