16
17
<refsynopsisdiv id="gnutls-pkcs12.synopsis" role="synopsis">
17
18
<title role="synopsis.title">Synopsis</title>
20
struct <link linkend="gnutls-pkcs12-int">gnutls_pkcs12_int</link>;
20
<synopsis>struct <link linkend="gnutls-pkcs12-int">gnutls_pkcs12_int</link>;
21
21
typedef <link linkend="gnutls-pkcs12-t">gnutls_pkcs12_t</link>;
22
22
struct <link linkend="gnutls-pkcs12-bag-int">gnutls_pkcs12_bag_int</link>;
23
23
typedef <link linkend="gnutls-pkcs12-bag-t">gnutls_pkcs12_bag_t</link>;
24
<link linkend="int">int</link> <link linkend="gnutls-pkcs12-init">gnutls_pkcs12_init</link> (<link linkend="gnutls-pkcs12-t">gnutls_pkcs12_t</link> *pkcs12);
25
<link linkend="void">void</link> <link linkend="gnutls-pkcs12-deinit">gnutls_pkcs12_deinit</link> (<link linkend="gnutls-pkcs12-t">gnutls_pkcs12_t</link> pkcs12);
26
<link linkend="int">int</link> <link linkend="gnutls-pkcs12-import">gnutls_pkcs12_import</link> (<link linkend="gnutls-pkcs12-t">gnutls_pkcs12_t</link> pkcs12,
27
const <link linkend="gnutls-datum-t">gnutls_datum_t</link> *data,
28
<link linkend="gnutls-x509-crt-fmt-t">gnutls_x509_crt_fmt_t</link> format,
29
unsigned <link linkend="int">int</link> flags);
30
<link linkend="int">int</link> <link linkend="gnutls-pkcs12-export">gnutls_pkcs12_export</link> (<link linkend="gnutls-pkcs12-t">gnutls_pkcs12_t</link> pkcs12,
31
<link linkend="gnutls-x509-crt-fmt-t">gnutls_x509_crt_fmt_t</link> format,
32
<link linkend="void">void</link> *output_data,
33
<link linkend="size-t">size_t</link> *output_data_size);
34
<link linkend="int">int</link> <link linkend="gnutls-pkcs12-get-bag">gnutls_pkcs12_get_bag</link> (<link linkend="gnutls-pkcs12-t">gnutls_pkcs12_t</link> pkcs12,
35
<link linkend="int">int</link> indx,
36
<link linkend="gnutls-pkcs12-bag-t">gnutls_pkcs12_bag_t</link> bag);
37
<link linkend="int">int</link> <link linkend="gnutls-pkcs12-set-bag">gnutls_pkcs12_set_bag</link> (<link linkend="gnutls-pkcs12-t">gnutls_pkcs12_t</link> pkcs12,
38
<link linkend="gnutls-pkcs12-bag-t">gnutls_pkcs12_bag_t</link> bag);
39
<link linkend="int">int</link> <link linkend="gnutls-pkcs12-generate-mac">gnutls_pkcs12_generate_mac</link> (<link linkend="gnutls-pkcs12-t">gnutls_pkcs12_t</link> pkcs12,
40
const <link linkend="char">char</link> *pass);
41
<link linkend="int">int</link> <link linkend="gnutls-pkcs12-verify-mac">gnutls_pkcs12_verify_mac</link> (<link linkend="gnutls-pkcs12-t">gnutls_pkcs12_t</link> pkcs12,
42
const <link linkend="char">char</link> *pass);
43
<link linkend="int">int</link> <link linkend="gnutls-pkcs12-bag-decrypt">gnutls_pkcs12_bag_decrypt</link> (<link linkend="gnutls-pkcs12-bag-t">gnutls_pkcs12_bag_t</link> bag,
44
const <link linkend="char">char</link> *pass);
45
<link linkend="int">int</link> <link linkend="gnutls-pkcs12-bag-encrypt">gnutls_pkcs12_bag_encrypt</link> (<link linkend="gnutls-pkcs12-bag-t">gnutls_pkcs12_bag_t</link> bag,
46
const <link linkend="char">char</link> *pass,
47
unsigned <link linkend="int">int</link> flags);
24
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-pkcs12-init">gnutls_pkcs12_init</link> (<parameter><link linkend="gnutls-pkcs12-t"><type>gnutls_pkcs12_t</type></link> *pkcs12</parameter>);
25
<link linkend="void"><returnvalue>void</returnvalue></link> <link linkend="gnutls-pkcs12-deinit">gnutls_pkcs12_deinit</link> (<parameter><link linkend="gnutls-pkcs12-t"><type>gnutls_pkcs12_t</type></link> pkcs12</parameter>);
26
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-pkcs12-import">gnutls_pkcs12_import</link> (<parameter><link linkend="gnutls-pkcs12-t"><type>gnutls_pkcs12_t</type></link> pkcs12</parameter>,
27
<parameter>const <link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *data</parameter>,
28
<parameter><link linkend="gnutls-x509-crt-fmt-t"><type>gnutls_x509_crt_fmt_t</type></link> format</parameter>,
29
<parameter>unsigned <link linkend="int"><type>int</type></link> flags</parameter>);
30
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-pkcs12-export">gnutls_pkcs12_export</link> (<parameter><link linkend="gnutls-pkcs12-t"><type>gnutls_pkcs12_t</type></link> pkcs12</parameter>,
31
<parameter><link linkend="gnutls-x509-crt-fmt-t"><type>gnutls_x509_crt_fmt_t</type></link> format</parameter>,
32
<parameter><link linkend="void"><type>void</type></link> *output_data</parameter>,
33
<parameter><link linkend="size-t"><type>size_t</type></link> *output_data_size</parameter>);
34
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-pkcs12-get-bag">gnutls_pkcs12_get_bag</link> (<parameter><link linkend="gnutls-pkcs12-t"><type>gnutls_pkcs12_t</type></link> pkcs12</parameter>,
35
<parameter><link linkend="int"><type>int</type></link> indx</parameter>,
36
<parameter><link linkend="gnutls-pkcs12-bag-t"><type>gnutls_pkcs12_bag_t</type></link> bag</parameter>);
37
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-pkcs12-set-bag">gnutls_pkcs12_set_bag</link> (<parameter><link linkend="gnutls-pkcs12-t"><type>gnutls_pkcs12_t</type></link> pkcs12</parameter>,
38
<parameter><link linkend="gnutls-pkcs12-bag-t"><type>gnutls_pkcs12_bag_t</type></link> bag</parameter>);
39
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-pkcs12-generate-mac">gnutls_pkcs12_generate_mac</link> (<parameter><link linkend="gnutls-pkcs12-t"><type>gnutls_pkcs12_t</type></link> pkcs12</parameter>,
40
<parameter>const <link linkend="char"><type>char</type></link> *pass</parameter>);
41
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-pkcs12-verify-mac">gnutls_pkcs12_verify_mac</link> (<parameter><link linkend="gnutls-pkcs12-t"><type>gnutls_pkcs12_t</type></link> pkcs12</parameter>,
42
<parameter>const <link linkend="char"><type>char</type></link> *pass</parameter>);
43
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-pkcs12-bag-decrypt">gnutls_pkcs12_bag_decrypt</link> (<parameter><link linkend="gnutls-pkcs12-bag-t"><type>gnutls_pkcs12_bag_t</type></link> bag</parameter>,
44
<parameter>const <link linkend="char"><type>char</type></link> *pass</parameter>);
45
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-pkcs12-bag-encrypt">gnutls_pkcs12_bag_encrypt</link> (<parameter><link linkend="gnutls-pkcs12-bag-t"><type>gnutls_pkcs12_bag_t</type></link> bag</parameter>,
46
<parameter>const <link linkend="char"><type>char</type></link> *pass</parameter>,
47
<parameter>unsigned <link linkend="int"><type>int</type></link> flags</parameter>);
48
48
enum <link linkend="gnutls-pkcs12-bag-type-t">gnutls_pkcs12_bag_type_t</link>;
49
<link linkend="gnutls-pkcs12-bag-type-t">gnutls_pkcs12_bag_type_t</link> <link linkend="gnutls-pkcs12-bag-get-type">gnutls_pkcs12_bag_get_type</link> (<link linkend="gnutls-pkcs12-bag-t">gnutls_pkcs12_bag_t</link> bag,
50
<link linkend="int">int</link> indx);
51
<link linkend="int">int</link> <link linkend="gnutls-pkcs12-bag-get-data">gnutls_pkcs12_bag_get_data</link> (<link linkend="gnutls-pkcs12-bag-t">gnutls_pkcs12_bag_t</link> bag,
52
<link linkend="int">int</link> indx,
53
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *data);
54
<link linkend="int">int</link> <link linkend="gnutls-pkcs12-bag-set-data">gnutls_pkcs12_bag_set_data</link> (<link linkend="gnutls-pkcs12-bag-t">gnutls_pkcs12_bag_t</link> bag,
55
<link linkend="gnutls-pkcs12-bag-type-t">gnutls_pkcs12_bag_type_t</link> type,
56
const <link linkend="gnutls-datum-t">gnutls_datum_t</link> *data);
57
<link linkend="int">int</link> <link linkend="gnutls-pkcs12-bag-set-crl">gnutls_pkcs12_bag_set_crl</link> (<link linkend="gnutls-pkcs12-bag-t">gnutls_pkcs12_bag_t</link> bag,
58
<link linkend="gnutls-x509-crl-t">gnutls_x509_crl_t</link> crl);
59
<link linkend="int">int</link> <link linkend="gnutls-pkcs12-bag-set-crt">gnutls_pkcs12_bag_set_crt</link> (<link linkend="gnutls-pkcs12-bag-t">gnutls_pkcs12_bag_t</link> bag,
60
<link linkend="gnutls-x509-crt-t">gnutls_x509_crt_t</link> crt);
61
<link linkend="int">int</link> <link linkend="gnutls-pkcs12-bag-init">gnutls_pkcs12_bag_init</link> (<link linkend="gnutls-pkcs12-bag-t">gnutls_pkcs12_bag_t</link> *bag);
62
<link linkend="void">void</link> <link linkend="gnutls-pkcs12-bag-deinit">gnutls_pkcs12_bag_deinit</link> (<link linkend="gnutls-pkcs12-bag-t">gnutls_pkcs12_bag_t</link> bag);
63
<link linkend="int">int</link> <link linkend="gnutls-pkcs12-bag-get-count">gnutls_pkcs12_bag_get_count</link> (<link linkend="gnutls-pkcs12-bag-t">gnutls_pkcs12_bag_t</link> bag);
64
<link linkend="int">int</link> <link linkend="gnutls-pkcs12-bag-get-key-id">gnutls_pkcs12_bag_get_key_id</link> (<link linkend="gnutls-pkcs12-bag-t">gnutls_pkcs12_bag_t</link> bag,
65
<link linkend="int">int</link> indx,
66
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *id);
67
<link linkend="int">int</link> <link linkend="gnutls-pkcs12-bag-set-key-id">gnutls_pkcs12_bag_set_key_id</link> (<link linkend="gnutls-pkcs12-bag-t">gnutls_pkcs12_bag_t</link> bag,
68
<link linkend="int">int</link> indx,
69
const <link linkend="gnutls-datum-t">gnutls_datum_t</link> *id);
70
<link linkend="int">int</link> <link linkend="gnutls-pkcs12-bag-get-friendly-name">gnutls_pkcs12_bag_get_friendly_name</link> (<link linkend="gnutls-pkcs12-bag-t">gnutls_pkcs12_bag_t</link> bag,
71
<link linkend="int">int</link> indx,
72
<link linkend="char">char</link> **name);
73
<link linkend="int">int</link> <link linkend="gnutls-pkcs12-bag-set-friendly-name">gnutls_pkcs12_bag_set_friendly_name</link> (<link linkend="gnutls-pkcs12-bag-t">gnutls_pkcs12_bag_t</link> bag,
74
<link linkend="int">int</link> indx,
75
const <link linkend="char">char</link> *name);
49
<link linkend="gnutls-pkcs12-bag-type-t"><returnvalue>gnutls_pkcs12_bag_type_t</returnvalue></link> <link linkend="gnutls-pkcs12-bag-get-type">gnutls_pkcs12_bag_get_type</link> (<parameter><link linkend="gnutls-pkcs12-bag-t"><type>gnutls_pkcs12_bag_t</type></link> bag</parameter>,
50
<parameter><link linkend="int"><type>int</type></link> indx</parameter>);
51
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-pkcs12-bag-get-data">gnutls_pkcs12_bag_get_data</link> (<parameter><link linkend="gnutls-pkcs12-bag-t"><type>gnutls_pkcs12_bag_t</type></link> bag</parameter>,
52
<parameter><link linkend="int"><type>int</type></link> indx</parameter>,
53
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *data</parameter>);
54
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-pkcs12-bag-set-data">gnutls_pkcs12_bag_set_data</link> (<parameter><link linkend="gnutls-pkcs12-bag-t"><type>gnutls_pkcs12_bag_t</type></link> bag</parameter>,
55
<parameter><link linkend="gnutls-pkcs12-bag-type-t"><type>gnutls_pkcs12_bag_type_t</type></link> type</parameter>,
56
<parameter>const <link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *data</parameter>);
57
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-pkcs12-bag-set-crl">gnutls_pkcs12_bag_set_crl</link> (<parameter><link linkend="gnutls-pkcs12-bag-t"><type>gnutls_pkcs12_bag_t</type></link> bag</parameter>,
58
<parameter><link linkend="gnutls-x509-crl-t"><type>gnutls_x509_crl_t</type></link> crl</parameter>);
59
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-pkcs12-bag-set-crt">gnutls_pkcs12_bag_set_crt</link> (<parameter><link linkend="gnutls-pkcs12-bag-t"><type>gnutls_pkcs12_bag_t</type></link> bag</parameter>,
60
<parameter><link linkend="gnutls-x509-crt-t"><type>gnutls_x509_crt_t</type></link> crt</parameter>);
61
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-pkcs12-bag-init">gnutls_pkcs12_bag_init</link> (<parameter><link linkend="gnutls-pkcs12-bag-t"><type>gnutls_pkcs12_bag_t</type></link> *bag</parameter>);
62
<link linkend="void"><returnvalue>void</returnvalue></link> <link linkend="gnutls-pkcs12-bag-deinit">gnutls_pkcs12_bag_deinit</link> (<parameter><link linkend="gnutls-pkcs12-bag-t"><type>gnutls_pkcs12_bag_t</type></link> bag</parameter>);
63
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-pkcs12-bag-get-count">gnutls_pkcs12_bag_get_count</link> (<parameter><link linkend="gnutls-pkcs12-bag-t"><type>gnutls_pkcs12_bag_t</type></link> bag</parameter>);
64
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-pkcs12-bag-get-key-id">gnutls_pkcs12_bag_get_key_id</link> (<parameter><link linkend="gnutls-pkcs12-bag-t"><type>gnutls_pkcs12_bag_t</type></link> bag</parameter>,
65
<parameter><link linkend="int"><type>int</type></link> indx</parameter>,
66
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *id</parameter>);
67
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-pkcs12-bag-set-key-id">gnutls_pkcs12_bag_set_key_id</link> (<parameter><link linkend="gnutls-pkcs12-bag-t"><type>gnutls_pkcs12_bag_t</type></link> bag</parameter>,
68
<parameter><link linkend="int"><type>int</type></link> indx</parameter>,
69
<parameter>const <link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *id</parameter>);
70
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-pkcs12-bag-get-friendly-name">gnutls_pkcs12_bag_get_friendly_name</link> (<parameter><link linkend="gnutls-pkcs12-bag-t"><type>gnutls_pkcs12_bag_t</type></link> bag</parameter>,
71
<parameter><link linkend="int"><type>int</type></link> indx</parameter>,
72
<parameter><link linkend="char"><type>char</type></link> **name</parameter>);
73
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-pkcs12-bag-set-friendly-name">gnutls_pkcs12_bag_set_friendly_name</link> (<parameter><link linkend="gnutls-pkcs12-bag-t"><type>gnutls_pkcs12_bag_t</type></link> bag</parameter>,
74
<parameter><link linkend="int"><type>int</type></link> indx</parameter>,
75
<parameter>const <link linkend="char"><type>char</type></link> *name</parameter>);
87
79
<refsect1 id="gnutls-pkcs12.description" role="desc">
88
80
<title role="desc.title">Description</title>
93
84
<refsect1 id="gnutls-pkcs12.details" role="details">
94
85
<title role="details.title">Details</title>
95
86
<refsect2 id="gnutls-pkcs12-int" role="struct">
96
87
<title>struct gnutls_pkcs12_int</title>
97
<indexterm zone="gnutls-pkcs12-int"><primary sortas="gnutls_pkcs12_int">gnutls_pkcs12_int</primary></indexterm><programlisting>struct gnutls_pkcs12_int;</programlisting>
88
<indexterm zone="gnutls-pkcs12-int"><primary>gnutls_pkcs12_int</primary></indexterm>
89
<programlisting>struct gnutls_pkcs12_int;</programlisting>
100
92
<refsect2 id="gnutls-pkcs12-t" role="typedef">
101
93
<title>gnutls_pkcs12_t</title>
102
<indexterm zone="gnutls-pkcs12-t"><primary sortas="gnutls_pkcs12_t">gnutls_pkcs12_t</primary></indexterm><programlisting> typedef struct gnutls_pkcs12_int *gnutls_pkcs12_t;
94
<indexterm zone="gnutls-pkcs12-t"><primary>gnutls_pkcs12_t</primary></indexterm>
95
<programlisting> typedef struct gnutls_pkcs12_int *gnutls_pkcs12_t;
105
98
</para></refsect2>
106
99
<refsect2 id="gnutls-pkcs12-bag-int" role="struct">
107
100
<title>struct gnutls_pkcs12_bag_int</title>
108
<indexterm zone="gnutls-pkcs12-bag-int"><primary sortas="gnutls_pkcs12_bag_int">gnutls_pkcs12_bag_int</primary></indexterm><programlisting>struct gnutls_pkcs12_bag_int;</programlisting>
101
<indexterm zone="gnutls-pkcs12-bag-int"><primary>gnutls_pkcs12_bag_int</primary></indexterm>
102
<programlisting>struct gnutls_pkcs12_bag_int;</programlisting>
110
104
</para></refsect2>
111
105
<refsect2 id="gnutls-pkcs12-bag-t" role="typedef">
112
106
<title>gnutls_pkcs12_bag_t</title>
113
<indexterm zone="gnutls-pkcs12-bag-t"><primary sortas="gnutls_pkcs12_bag_t">gnutls_pkcs12_bag_t</primary></indexterm><programlisting> typedef struct gnutls_pkcs12_bag_int *gnutls_pkcs12_bag_t;
107
<indexterm zone="gnutls-pkcs12-bag-t"><primary>gnutls_pkcs12_bag_t</primary></indexterm>
108
<programlisting> typedef struct gnutls_pkcs12_bag_int *gnutls_pkcs12_bag_t;
114
109
</programlisting>
116
111
</para></refsect2>
117
112
<refsect2 id="gnutls-pkcs12-init" role="function">
118
113
<title>gnutls_pkcs12_init ()</title>
119
<indexterm zone="gnutls-pkcs12-init"><primary sortas="gnutls_pkcs12_init">gnutls_pkcs12_init</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_pkcs12_init (<link linkend="gnutls-pkcs12-t">gnutls_pkcs12_t</link> *pkcs12);</programlisting>
121
This function will initialize a PKCS12 structure. PKCS12 structures
122
usually contain lists of X.509 Certificates and X.509 Certificate
123
revocation lists.</para>
114
<indexterm zone="gnutls-pkcs12-init"><primary>gnutls_pkcs12_init</primary></indexterm>
115
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_pkcs12_init (<parameter><link linkend="gnutls-pkcs12-t"><type>gnutls_pkcs12_t</type></link> *pkcs12</parameter>);</programlisting>
125
117
</para><variablelist role="params">
126
118
<varlistentry><term><parameter>pkcs12</parameter> :</term>
127
<listitem><simpara> The structure to be initialized
128
120
</simpara></listitem></varlistentry>
129
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> On success, <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> is returned, otherwise a
130
negative error value.
121
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
132
122
</simpara></listitem></varlistentry>
133
123
</variablelist></refsect2>
134
124
<refsect2 id="gnutls-pkcs12-deinit" role="function">
135
125
<title>gnutls_pkcs12_deinit ()</title>
136
<indexterm zone="gnutls-pkcs12-deinit"><primary sortas="gnutls_pkcs12_deinit">gnutls_pkcs12_deinit</primary></indexterm><programlisting><link linkend="void">void</link> gnutls_pkcs12_deinit (<link linkend="gnutls-pkcs12-t">gnutls_pkcs12_t</link> pkcs12);</programlisting>
138
This function will deinitialize a PKCS12 structure.</para>
126
<indexterm zone="gnutls-pkcs12-deinit"><primary>gnutls_pkcs12_deinit</primary></indexterm>
127
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link> gnutls_pkcs12_deinit (<parameter><link linkend="gnutls-pkcs12-t"><type>gnutls_pkcs12_t</type></link> pkcs12</parameter>);</programlisting>
140
129
</para><variablelist role="params">
141
130
<varlistentry><term><parameter>pkcs12</parameter> :</term>
142
<listitem><simpara> The structure to be initialized
143
132
</simpara></listitem></varlistentry>
144
133
</variablelist></refsect2>
145
134
<refsect2 id="gnutls-pkcs12-import" role="function">
146
135
<title>gnutls_pkcs12_import ()</title>
147
<indexterm zone="gnutls-pkcs12-import"><primary sortas="gnutls_pkcs12_import">gnutls_pkcs12_import</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_pkcs12_import (<link linkend="gnutls-pkcs12-t">gnutls_pkcs12_t</link> pkcs12,
148
const <link linkend="gnutls-datum-t">gnutls_datum_t</link> *data,
149
<link linkend="gnutls-x509-crt-fmt-t">gnutls_x509_crt_fmt_t</link> format,
150
unsigned <link linkend="int">int</link> flags);</programlisting>
152
This function will convert the given DER or PEM encoded PKCS12
153
to the native gnutls_pkcs12_t format. The output will be stored in 'pkcs12'.
156
If the PKCS12 is PEM encoded it should have a header of "PKCS12".</para>
136
<indexterm zone="gnutls-pkcs12-import"><primary>gnutls_pkcs12_import</primary></indexterm>
137
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_pkcs12_import (<parameter><link linkend="gnutls-pkcs12-t"><type>gnutls_pkcs12_t</type></link> pkcs12</parameter>,
138
<parameter>const <link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *data</parameter>,
139
<parameter><link linkend="gnutls-x509-crt-fmt-t"><type>gnutls_x509_crt_fmt_t</type></link> format</parameter>,
140
<parameter>unsigned <link linkend="int"><type>int</type></link> flags</parameter>);</programlisting>
158
142
</para><variablelist role="params">
159
143
<varlistentry><term><parameter>pkcs12</parameter> :</term>
160
<listitem><simpara> The structure to store the parsed PKCS12.
161
145
</simpara></listitem></varlistentry>
162
146
<varlistentry><term><parameter>data</parameter> :</term>
163
<listitem><simpara> The DER or PEM encoded PKCS12.
164
148
</simpara></listitem></varlistentry>
165
149
<varlistentry><term><parameter>format</parameter> :</term>
166
<listitem><simpara> One of DER or PEM
167
151
</simpara></listitem></varlistentry>
168
152
<varlistentry><term><parameter>flags</parameter> :</term>
169
<listitem><simpara> an ORed sequence of gnutls_privkey_pkcs8_flags
170
154
</simpara></listitem></varlistentry>
171
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> On success, <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> is returned, otherwise a
172
negative error value.
155
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
174
156
</simpara></listitem></varlistentry>
175
157
</variablelist></refsect2>
176
158
<refsect2 id="gnutls-pkcs12-export" role="function">
177
159
<title>gnutls_pkcs12_export ()</title>
178
<indexterm zone="gnutls-pkcs12-export"><primary sortas="gnutls_pkcs12_export">gnutls_pkcs12_export</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_pkcs12_export (<link linkend="gnutls-pkcs12-t">gnutls_pkcs12_t</link> pkcs12,
179
<link linkend="gnutls-x509-crt-fmt-t">gnutls_x509_crt_fmt_t</link> format,
180
<link linkend="void">void</link> *output_data,
181
<link linkend="size-t">size_t</link> *output_data_size);</programlisting>
183
This function will export the pkcs12 structure to DER or PEM format.
186
If the buffer provided is not long enough to hold the output, then
187
*output_data_size will be updated and GNUTLS_E_SHORT_MEMORY_BUFFER
191
If the structure is PEM encoded, it will have a header
192
of "BEGIN PKCS12".</para>
160
<indexterm zone="gnutls-pkcs12-export"><primary>gnutls_pkcs12_export</primary></indexterm>
161
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_pkcs12_export (<parameter><link linkend="gnutls-pkcs12-t"><type>gnutls_pkcs12_t</type></link> pkcs12</parameter>,
162
<parameter><link linkend="gnutls-x509-crt-fmt-t"><type>gnutls_x509_crt_fmt_t</type></link> format</parameter>,
163
<parameter><link linkend="void"><type>void</type></link> *output_data</parameter>,
164
<parameter><link linkend="size-t"><type>size_t</type></link> *output_data_size</parameter>);</programlisting>
194
166
</para><variablelist role="params">
195
167
<varlistentry><term><parameter>pkcs12</parameter> :</term>
196
<listitem><simpara> Holds the pkcs12 structure
197
169
</simpara></listitem></varlistentry>
198
170
<varlistentry><term><parameter>format</parameter> :</term>
199
<listitem><simpara> the format of output params. One of PEM or DER.
200
172
</simpara></listitem></varlistentry>
201
173
<varlistentry><term><parameter>output_data</parameter> :</term>
202
<listitem><simpara> will contain a structure PEM or DER encoded
203
175
</simpara></listitem></varlistentry>
204
176
<varlistentry><term><parameter>output_data_size</parameter> :</term>
205
<listitem><simpara> holds the size of output_data (and will be
206
replaced by the actual size of parameters)
207
178
</simpara></listitem></varlistentry>
208
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> In case of failure a negative value will be
209
returned, and 0 on success.
179
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
211
180
</simpara></listitem></varlistentry>
212
181
</variablelist></refsect2>
213
182
<refsect2 id="gnutls-pkcs12-get-bag" role="function">
214
183
<title>gnutls_pkcs12_get_bag ()</title>
215
<indexterm zone="gnutls-pkcs12-get-bag"><primary sortas="gnutls_pkcs12_get_bag">gnutls_pkcs12_get_bag</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_pkcs12_get_bag (<link linkend="gnutls-pkcs12-t">gnutls_pkcs12_t</link> pkcs12,
216
<link linkend="int">int</link> indx,
217
<link linkend="gnutls-pkcs12-bag-t">gnutls_pkcs12_bag_t</link> bag);</programlisting>
219
This function will return a Bag from the PKCS12 structure.</para>
184
<indexterm zone="gnutls-pkcs12-get-bag"><primary>gnutls_pkcs12_get_bag</primary></indexterm>
185
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_pkcs12_get_bag (<parameter><link linkend="gnutls-pkcs12-t"><type>gnutls_pkcs12_t</type></link> pkcs12</parameter>,
186
<parameter><link linkend="int"><type>int</type></link> indx</parameter>,
187
<parameter><link linkend="gnutls-pkcs12-bag-t"><type>gnutls_pkcs12_bag_t</type></link> bag</parameter>);</programlisting>
221
189
</para><variablelist role="params">
222
190
<varlistentry><term><parameter>pkcs12</parameter> :</term>
223
<listitem><simpara> should contain a gnutls_pkcs12_t structure
224
192
</simpara></listitem></varlistentry>
225
193
<varlistentry><term><parameter>indx</parameter> :</term>
226
<listitem><simpara> contains the index of the bag to extract
227
195
</simpara></listitem></varlistentry>
228
196
<varlistentry><term><parameter>bag</parameter> :</term>
229
<listitem><simpara> An initialized bag, where the contents of the bag will be copied
230
198
</simpara></listitem></varlistentry>
231
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> On success, <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> is returned, otherwise a
232
negative error value.
234
After the last Bag has been read GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE
199
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
237
200
</simpara></listitem></varlistentry>
238
201
</variablelist></refsect2>
239
202
<refsect2 id="gnutls-pkcs12-set-bag" role="function">
240
203
<title>gnutls_pkcs12_set_bag ()</title>
241
<indexterm zone="gnutls-pkcs12-set-bag"><primary sortas="gnutls_pkcs12_set_bag">gnutls_pkcs12_set_bag</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_pkcs12_set_bag (<link linkend="gnutls-pkcs12-t">gnutls_pkcs12_t</link> pkcs12,
242
<link linkend="gnutls-pkcs12-bag-t">gnutls_pkcs12_bag_t</link> bag);</programlisting>
244
This function will insert a Bag into the PKCS12 structure.</para>
204
<indexterm zone="gnutls-pkcs12-set-bag"><primary>gnutls_pkcs12_set_bag</primary></indexterm>
205
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_pkcs12_set_bag (<parameter><link linkend="gnutls-pkcs12-t"><type>gnutls_pkcs12_t</type></link> pkcs12</parameter>,
206
<parameter><link linkend="gnutls-pkcs12-bag-t"><type>gnutls_pkcs12_bag_t</type></link> bag</parameter>);</programlisting>
246
208
</para><variablelist role="params">
247
209
<varlistentry><term><parameter>pkcs12</parameter> :</term>
248
<listitem><simpara> should contain a gnutls_pkcs12_t structure
249
211
</simpara></listitem></varlistentry>
250
212
<varlistentry><term><parameter>bag</parameter> :</term>
251
<listitem><simpara> An initialized bag
252
214
</simpara></listitem></varlistentry>
253
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> On success, <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> is returned, otherwise a
254
negative error value.
215
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
256
216
</simpara></listitem></varlistentry>
257
217
</variablelist></refsect2>
258
218
<refsect2 id="gnutls-pkcs12-generate-mac" role="function">
259
219
<title>gnutls_pkcs12_generate_mac ()</title>
260
<indexterm zone="gnutls-pkcs12-generate-mac"><primary sortas="gnutls_pkcs12_generate_mac">gnutls_pkcs12_generate_mac</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_pkcs12_generate_mac (<link linkend="gnutls-pkcs12-t">gnutls_pkcs12_t</link> pkcs12,
261
const <link linkend="char">char</link> *pass);</programlisting>
263
This function will generate a MAC for the PKCS12 structure.</para>
220
<indexterm zone="gnutls-pkcs12-generate-mac"><primary>gnutls_pkcs12_generate_mac</primary></indexterm>
221
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_pkcs12_generate_mac (<parameter><link linkend="gnutls-pkcs12-t"><type>gnutls_pkcs12_t</type></link> pkcs12</parameter>,
222
<parameter>const <link linkend="char"><type>char</type></link> *pass</parameter>);</programlisting>
265
224
</para><variablelist role="params">
266
225
<varlistentry><term><parameter>pkcs12</parameter> :</term>
267
<listitem><simpara> should contain a gnutls_pkcs12_t structure
268
227
</simpara></listitem></varlistentry>
269
228
<varlistentry><term><parameter>pass</parameter> :</term>
270
<listitem><simpara> The password for the MAC
271
230
</simpara></listitem></varlistentry>
272
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> On success, <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> is returned, otherwise a
273
negative error value.
231
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
275
232
</simpara></listitem></varlistentry>
276
233
</variablelist></refsect2>
277
234
<refsect2 id="gnutls-pkcs12-verify-mac" role="function">
278
235
<title>gnutls_pkcs12_verify_mac ()</title>
279
<indexterm zone="gnutls-pkcs12-verify-mac"><primary sortas="gnutls_pkcs12_verify_mac">gnutls_pkcs12_verify_mac</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_pkcs12_verify_mac (<link linkend="gnutls-pkcs12-t">gnutls_pkcs12_t</link> pkcs12,
280
const <link linkend="char">char</link> *pass);</programlisting>
282
This function will verify the MAC for the PKCS12 structure.</para>
236
<indexterm zone="gnutls-pkcs12-verify-mac"><primary>gnutls_pkcs12_verify_mac</primary></indexterm>
237
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_pkcs12_verify_mac (<parameter><link linkend="gnutls-pkcs12-t"><type>gnutls_pkcs12_t</type></link> pkcs12</parameter>,
238
<parameter>const <link linkend="char"><type>char</type></link> *pass</parameter>);</programlisting>
284
240
</para><variablelist role="params">
285
241
<varlistentry><term><parameter>pkcs12</parameter> :</term>
286
<listitem><simpara> should contain a gnutls_pkcs12_t structure
287
243
</simpara></listitem></varlistentry>
288
244
<varlistentry><term><parameter>pass</parameter> :</term>
289
<listitem><simpara> The password for the MAC
290
246
</simpara></listitem></varlistentry>
291
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> On success, <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> is returned, otherwise a
292
negative error value.
247
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
294
248
</simpara></listitem></varlistentry>
295
249
</variablelist></refsect2>
296
250
<refsect2 id="gnutls-pkcs12-bag-decrypt" role="function">
297
251
<title>gnutls_pkcs12_bag_decrypt ()</title>
298
<indexterm zone="gnutls-pkcs12-bag-decrypt"><primary sortas="gnutls_pkcs12_bag_decrypt">gnutls_pkcs12_bag_decrypt</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_pkcs12_bag_decrypt (<link linkend="gnutls-pkcs12-bag-t">gnutls_pkcs12_bag_t</link> bag,
299
const <link linkend="char">char</link> *pass);</programlisting>
301
This function will decrypt the given encrypted bag and return 0 on
252
<indexterm zone="gnutls-pkcs12-bag-decrypt"><primary>gnutls_pkcs12_bag_decrypt</primary></indexterm>
253
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_pkcs12_bag_decrypt (<parameter><link linkend="gnutls-pkcs12-bag-t"><type>gnutls_pkcs12_bag_t</type></link> bag</parameter>,
254
<parameter>const <link linkend="char"><type>char</type></link> *pass</parameter>);</programlisting>
304
256
</para><variablelist role="params">
305
257
<varlistentry><term><parameter>bag</parameter> :</term>
306
<listitem><simpara> The bag
307
259
</simpara></listitem></varlistentry>
308
260
<varlistentry><term><parameter>pass</parameter> :</term>
309
<listitem><simpara> The password used for encryption, must be ASCII.
310
262
</simpara></listitem></varlistentry>
311
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> On success, <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> (zero) is returned,
312
otherwise an error code is returned.
263
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
313
264
</simpara></listitem></varlistentry>
314
265
</variablelist></refsect2>
315
266
<refsect2 id="gnutls-pkcs12-bag-encrypt" role="function">
316
267
<title>gnutls_pkcs12_bag_encrypt ()</title>
317
<indexterm zone="gnutls-pkcs12-bag-encrypt"><primary sortas="gnutls_pkcs12_bag_encrypt">gnutls_pkcs12_bag_encrypt</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_pkcs12_bag_encrypt (<link linkend="gnutls-pkcs12-bag-t">gnutls_pkcs12_bag_t</link> bag,
318
const <link linkend="char">char</link> *pass,
319
unsigned <link linkend="int">int</link> flags);</programlisting>
321
This function will encrypt the given bag.</para>
268
<indexterm zone="gnutls-pkcs12-bag-encrypt"><primary>gnutls_pkcs12_bag_encrypt</primary></indexterm>
269
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_pkcs12_bag_encrypt (<parameter><link linkend="gnutls-pkcs12-bag-t"><type>gnutls_pkcs12_bag_t</type></link> bag</parameter>,
270
<parameter>const <link linkend="char"><type>char</type></link> *pass</parameter>,
271
<parameter>unsigned <link linkend="int"><type>int</type></link> flags</parameter>);</programlisting>
323
273
</para><variablelist role="params">
324
274
<varlistentry><term><parameter>bag</parameter> :</term>
325
<listitem><simpara> The bag
326
276
</simpara></listitem></varlistentry>
327
277
<varlistentry><term><parameter>pass</parameter> :</term>
328
<listitem><simpara> The password used for encryption, must be ASCII
329
279
</simpara></listitem></varlistentry>
330
280
<varlistentry><term><parameter>flags</parameter> :</term>
331
<listitem><simpara> should be one of <link linkend="gnutls-pkcs-encrypt-flags-t"><type>gnutls_pkcs_encrypt_flags_t</type></link> elements bitwise or'd
332
282
</simpara></listitem></varlistentry>
333
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> On success, <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> (zero) is returned,
334
otherwise an error code is returned.
283
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
335
284
</simpara></listitem></varlistentry>
336
285
</variablelist></refsect2>
337
286
<refsect2 id="gnutls-pkcs12-bag-type-t" role="enum">
338
287
<title>enum gnutls_pkcs12_bag_type_t</title>
339
<indexterm zone="gnutls-pkcs12-bag-type-t"><primary sortas="gnutls_pkcs12_bag_type_t">gnutls_pkcs12_bag_type_t</primary></indexterm><programlisting> typedef enum gnutls_pkcs12_bag_type_t
288
<indexterm zone="gnutls-pkcs12-bag-type-t"><primary>gnutls_pkcs12_bag_type_t</primary></indexterm>
289
<programlisting> typedef enum gnutls_pkcs12_bag_type_t
341
291
GNUTLS_BAG_EMPTY = 0,
352
302
</para></refsect2>
353
303
<refsect2 id="gnutls-pkcs12-bag-get-type" role="function">
354
304
<title>gnutls_pkcs12_bag_get_type ()</title>
355
<indexterm zone="gnutls-pkcs12-bag-get-type"><primary sortas="gnutls_pkcs12_bag_get_type">gnutls_pkcs12_bag_get_type</primary></indexterm><programlisting><link linkend="gnutls-pkcs12-bag-type-t">gnutls_pkcs12_bag_type_t</link> gnutls_pkcs12_bag_get_type (<link linkend="gnutls-pkcs12-bag-t">gnutls_pkcs12_bag_t</link> bag,
356
<link linkend="int">int</link> indx);</programlisting>
358
This function will return the bag's type.</para>
305
<indexterm zone="gnutls-pkcs12-bag-get-type"><primary>gnutls_pkcs12_bag_get_type</primary></indexterm>
306
<programlisting><link linkend="gnutls-pkcs12-bag-type-t"><returnvalue>gnutls_pkcs12_bag_type_t</returnvalue></link> gnutls_pkcs12_bag_get_type (<parameter><link linkend="gnutls-pkcs12-bag-t"><type>gnutls_pkcs12_bag_t</type></link> bag</parameter>,
307
<parameter><link linkend="int"><type>int</type></link> indx</parameter>);</programlisting>
360
309
</para><variablelist role="params">
361
310
<varlistentry><term><parameter>bag</parameter> :</term>
362
<listitem><simpara> The bag
363
312
</simpara></listitem></varlistentry>
364
313
<varlistentry><term><parameter>indx</parameter> :</term>
365
<listitem><simpara> The element of the bag to get the type
366
315
</simpara></listitem></varlistentry>
367
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> One of the <link linkend="gnutls-pkcs12-bag-type-t"><type>gnutls_pkcs12_bag_type_t</type></link> enumerations.
316
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
368
317
</simpara></listitem></varlistentry>
369
318
</variablelist></refsect2>
370
319
<refsect2 id="gnutls-pkcs12-bag-get-data" role="function">
371
320
<title>gnutls_pkcs12_bag_get_data ()</title>
372
<indexterm zone="gnutls-pkcs12-bag-get-data"><primary sortas="gnutls_pkcs12_bag_get_data">gnutls_pkcs12_bag_get_data</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_pkcs12_bag_get_data (<link linkend="gnutls-pkcs12-bag-t">gnutls_pkcs12_bag_t</link> bag,
373
<link linkend="int">int</link> indx,
374
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *data);</programlisting>
376
This function will return the bag's data. The data is a constant
377
that is stored into the bag. Should not be accessed after the bag
321
<indexterm zone="gnutls-pkcs12-bag-get-data"><primary>gnutls_pkcs12_bag_get_data</primary></indexterm>
322
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_pkcs12_bag_get_data (<parameter><link linkend="gnutls-pkcs12-bag-t"><type>gnutls_pkcs12_bag_t</type></link> bag</parameter>,
323
<parameter><link linkend="int"><type>int</type></link> indx</parameter>,
324
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *data</parameter>);</programlisting>
380
326
</para><variablelist role="params">
381
327
<varlistentry><term><parameter>bag</parameter> :</term>
382
<listitem><simpara> The bag
383
329
</simpara></listitem></varlistentry>
384
330
<varlistentry><term><parameter>indx</parameter> :</term>
385
<listitem><simpara> The element of the bag to get the data from
386
332
</simpara></listitem></varlistentry>
387
333
<varlistentry><term><parameter>data</parameter> :</term>
388
<listitem><simpara> where the bag's data will be. Should be treated as constant.
389
335
</simpara></listitem></varlistentry>
390
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> On success, <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> is returned, otherwise a
391
negative error value.and a negative error code on error.
336
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
393
337
</simpara></listitem></varlistentry>
394
338
</variablelist></refsect2>
395
339
<refsect2 id="gnutls-pkcs12-bag-set-data" role="function">
396
340
<title>gnutls_pkcs12_bag_set_data ()</title>
397
<indexterm zone="gnutls-pkcs12-bag-set-data"><primary sortas="gnutls_pkcs12_bag_set_data">gnutls_pkcs12_bag_set_data</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_pkcs12_bag_set_data (<link linkend="gnutls-pkcs12-bag-t">gnutls_pkcs12_bag_t</link> bag,
398
<link linkend="gnutls-pkcs12-bag-type-t">gnutls_pkcs12_bag_type_t</link> type,
399
const <link linkend="gnutls-datum-t">gnutls_datum_t</link> *data);</programlisting>
401
This function will insert the given data of the given type into
341
<indexterm zone="gnutls-pkcs12-bag-set-data"><primary>gnutls_pkcs12_bag_set_data</primary></indexterm>
342
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_pkcs12_bag_set_data (<parameter><link linkend="gnutls-pkcs12-bag-t"><type>gnutls_pkcs12_bag_t</type></link> bag</parameter>,
343
<parameter><link linkend="gnutls-pkcs12-bag-type-t"><type>gnutls_pkcs12_bag_type_t</type></link> type</parameter>,
344
<parameter>const <link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *data</parameter>);</programlisting>
404
346
</para><variablelist role="params">
405
347
<varlistentry><term><parameter>bag</parameter> :</term>
406
<listitem><simpara> The bag
407
349
</simpara></listitem></varlistentry>
408
350
<varlistentry><term><parameter>type</parameter> :</term>
409
<listitem><simpara> The data's type
410
352
</simpara></listitem></varlistentry>
411
353
<varlistentry><term><parameter>data</parameter> :</term>
412
<listitem><simpara> the data to be copied.
413
355
</simpara></listitem></varlistentry>
414
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the index of the added bag on success, or a negative
356
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
416
357
</simpara></listitem></varlistentry>
417
358
</variablelist></refsect2>
418
359
<refsect2 id="gnutls-pkcs12-bag-set-crl" role="function">
419
360
<title>gnutls_pkcs12_bag_set_crl ()</title>
420
<indexterm zone="gnutls-pkcs12-bag-set-crl"><primary sortas="gnutls_pkcs12_bag_set_crl">gnutls_pkcs12_bag_set_crl</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_pkcs12_bag_set_crl (<link linkend="gnutls-pkcs12-bag-t">gnutls_pkcs12_bag_t</link> bag,
421
<link linkend="gnutls-x509-crl-t">gnutls_x509_crl_t</link> crl);</programlisting>
423
This function will insert the given CRL into the
424
bag. This is just a wrapper over <link linkend="gnutls-pkcs12-bag-set-data"><function>gnutls_pkcs12_bag_set_data()</function></link>.</para>
361
<indexterm zone="gnutls-pkcs12-bag-set-crl"><primary>gnutls_pkcs12_bag_set_crl</primary></indexterm>
362
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_pkcs12_bag_set_crl (<parameter><link linkend="gnutls-pkcs12-bag-t"><type>gnutls_pkcs12_bag_t</type></link> bag</parameter>,
363
<parameter><link linkend="gnutls-x509-crl-t"><type>gnutls_x509_crl_t</type></link> crl</parameter>);</programlisting>
426
365
</para><variablelist role="params">
427
366
<varlistentry><term><parameter>bag</parameter> :</term>
428
<listitem><simpara> The bag
429
368
</simpara></listitem></varlistentry>
430
369
<varlistentry><term><parameter>crl</parameter> :</term>
431
<listitem><simpara> the CRL to be copied.
432
371
</simpara></listitem></varlistentry>
433
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the index of the added bag on success, or a negative value
372
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
435
373
</simpara></listitem></varlistentry>
436
374
</variablelist></refsect2>
437
375
<refsect2 id="gnutls-pkcs12-bag-set-crt" role="function">
438
376
<title>gnutls_pkcs12_bag_set_crt ()</title>
439
<indexterm zone="gnutls-pkcs12-bag-set-crt"><primary sortas="gnutls_pkcs12_bag_set_crt">gnutls_pkcs12_bag_set_crt</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_pkcs12_bag_set_crt (<link linkend="gnutls-pkcs12-bag-t">gnutls_pkcs12_bag_t</link> bag,
440
<link linkend="gnutls-x509-crt-t">gnutls_x509_crt_t</link> crt);</programlisting>
442
This function will insert the given certificate into the
443
bag. This is just a wrapper over <link linkend="gnutls-pkcs12-bag-set-data"><function>gnutls_pkcs12_bag_set_data()</function></link>.</para>
377
<indexterm zone="gnutls-pkcs12-bag-set-crt"><primary>gnutls_pkcs12_bag_set_crt</primary></indexterm>
378
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_pkcs12_bag_set_crt (<parameter><link linkend="gnutls-pkcs12-bag-t"><type>gnutls_pkcs12_bag_t</type></link> bag</parameter>,
379
<parameter><link linkend="gnutls-x509-crt-t"><type>gnutls_x509_crt_t</type></link> crt</parameter>);</programlisting>
445
381
</para><variablelist role="params">
446
382
<varlistentry><term><parameter>bag</parameter> :</term>
447
<listitem><simpara> The bag
448
384
</simpara></listitem></varlistentry>
449
385
<varlistentry><term><parameter>crt</parameter> :</term>
450
<listitem><simpara> the certificate to be copied.
451
387
</simpara></listitem></varlistentry>
452
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the index of the added bag on success, or a negative
388
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
454
389
</simpara></listitem></varlistentry>
455
390
</variablelist></refsect2>
456
391
<refsect2 id="gnutls-pkcs12-bag-init" role="function">
457
392
<title>gnutls_pkcs12_bag_init ()</title>
458
<indexterm zone="gnutls-pkcs12-bag-init"><primary sortas="gnutls_pkcs12_bag_init">gnutls_pkcs12_bag_init</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_pkcs12_bag_init (<link linkend="gnutls-pkcs12-bag-t">gnutls_pkcs12_bag_t</link> *bag);</programlisting>
460
This function will initialize a PKCS12 bag structure. PKCS12 Bags
461
usually contain private keys, lists of X.509 Certificates and X.509 Certificate
462
revocation lists.</para>
393
<indexterm zone="gnutls-pkcs12-bag-init"><primary>gnutls_pkcs12_bag_init</primary></indexterm>
394
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_pkcs12_bag_init (<parameter><link linkend="gnutls-pkcs12-bag-t"><type>gnutls_pkcs12_bag_t</type></link> *bag</parameter>);</programlisting>
464
396
</para><variablelist role="params">
465
397
<varlistentry><term><parameter>bag</parameter> :</term>
466
<listitem><simpara> The structure to be initialized
467
399
</simpara></listitem></varlistentry>
468
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> On success, <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> is returned, otherwise a
469
negative error value.
400
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
471
401
</simpara></listitem></varlistentry>
472
402
</variablelist></refsect2>
473
403
<refsect2 id="gnutls-pkcs12-bag-deinit" role="function">
474
404
<title>gnutls_pkcs12_bag_deinit ()</title>
475
<indexterm zone="gnutls-pkcs12-bag-deinit"><primary sortas="gnutls_pkcs12_bag_deinit">gnutls_pkcs12_bag_deinit</primary></indexterm><programlisting><link linkend="void">void</link> gnutls_pkcs12_bag_deinit (<link linkend="gnutls-pkcs12-bag-t">gnutls_pkcs12_bag_t</link> bag);</programlisting>
477
This function will deinitialize a PKCS12 Bag structure.</para>
405
<indexterm zone="gnutls-pkcs12-bag-deinit"><primary>gnutls_pkcs12_bag_deinit</primary></indexterm>
406
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link> gnutls_pkcs12_bag_deinit (<parameter><link linkend="gnutls-pkcs12-bag-t"><type>gnutls_pkcs12_bag_t</type></link> bag</parameter>);</programlisting>
479
408
</para><variablelist role="params">
480
409
<varlistentry><term><parameter>bag</parameter> :</term>
481
<listitem><simpara> The structure to be initialized
482
411
</simpara></listitem></varlistentry>
483
412
</variablelist></refsect2>
484
413
<refsect2 id="gnutls-pkcs12-bag-get-count" role="function">
485
414
<title>gnutls_pkcs12_bag_get_count ()</title>
486
<indexterm zone="gnutls-pkcs12-bag-get-count"><primary sortas="gnutls_pkcs12_bag_get_count">gnutls_pkcs12_bag_get_count</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_pkcs12_bag_get_count (<link linkend="gnutls-pkcs12-bag-t">gnutls_pkcs12_bag_t</link> bag);</programlisting>
488
This function will return the number of the elements withing the bag.</para>
415
<indexterm zone="gnutls-pkcs12-bag-get-count"><primary>gnutls_pkcs12_bag_get_count</primary></indexterm>
416
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_pkcs12_bag_get_count (<parameter><link linkend="gnutls-pkcs12-bag-t"><type>gnutls_pkcs12_bag_t</type></link> bag</parameter>);</programlisting>
490
418
</para><variablelist role="params">
491
419
<varlistentry><term><parameter>bag</parameter> :</term>
492
<listitem><simpara> The bag
493
421
</simpara></listitem></varlistentry>
494
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> Number of elements in bag, or an negative error code on
422
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
496
423
</simpara></listitem></varlistentry>
497
424
</variablelist></refsect2>
498
425
<refsect2 id="gnutls-pkcs12-bag-get-key-id" role="function">
499
426
<title>gnutls_pkcs12_bag_get_key_id ()</title>
500
<indexterm zone="gnutls-pkcs12-bag-get-key-id"><primary sortas="gnutls_pkcs12_bag_get_key_id">gnutls_pkcs12_bag_get_key_id</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_pkcs12_bag_get_key_id (<link linkend="gnutls-pkcs12-bag-t">gnutls_pkcs12_bag_t</link> bag,
501
<link linkend="int">int</link> indx,
502
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *id);</programlisting>
504
This function will return the key ID, of the specified bag element.
505
The key ID is usually used to distinguish the local private key and the certificate pair.</para>
427
<indexterm zone="gnutls-pkcs12-bag-get-key-id"><primary>gnutls_pkcs12_bag_get_key_id</primary></indexterm>
428
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_pkcs12_bag_get_key_id (<parameter><link linkend="gnutls-pkcs12-bag-t"><type>gnutls_pkcs12_bag_t</type></link> bag</parameter>,
429
<parameter><link linkend="int"><type>int</type></link> indx</parameter>,
430
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *id</parameter>);</programlisting>
507
432
</para><variablelist role="params">
508
433
<varlistentry><term><parameter>bag</parameter> :</term>
509
<listitem><simpara> The bag
510
435
</simpara></listitem></varlistentry>
511
436
<varlistentry><term><parameter>indx</parameter> :</term>
512
<listitem><simpara> The bag's element to add the id
513
438
</simpara></listitem></varlistentry>
514
439
<varlistentry><term><parameter>id</parameter> :</term>
515
<listitem><simpara> where the ID will be copied (to be treated as const)
516
441
</simpara></listitem></varlistentry>
517
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> On success, <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> is returned, otherwise a
518
negative error value. or a negative value on error.
442
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
520
443
</simpara></listitem></varlistentry>
521
444
</variablelist></refsect2>
522
445
<refsect2 id="gnutls-pkcs12-bag-set-key-id" role="function">
523
446
<title>gnutls_pkcs12_bag_set_key_id ()</title>
524
<indexterm zone="gnutls-pkcs12-bag-set-key-id"><primary sortas="gnutls_pkcs12_bag_set_key_id">gnutls_pkcs12_bag_set_key_id</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_pkcs12_bag_set_key_id (<link linkend="gnutls-pkcs12-bag-t">gnutls_pkcs12_bag_t</link> bag,
525
<link linkend="int">int</link> indx,
526
const <link linkend="gnutls-datum-t">gnutls_datum_t</link> *id);</programlisting>
528
This function will add the given key ID, to the specified, by the index, bag
529
element. The key ID will be encoded as a 'Local key identifier' bag attribute,
530
which is usually used to distinguish the local private key and the certificate pair.</para>
447
<indexterm zone="gnutls-pkcs12-bag-set-key-id"><primary>gnutls_pkcs12_bag_set_key_id</primary></indexterm>
448
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_pkcs12_bag_set_key_id (<parameter><link linkend="gnutls-pkcs12-bag-t"><type>gnutls_pkcs12_bag_t</type></link> bag</parameter>,
449
<parameter><link linkend="int"><type>int</type></link> indx</parameter>,
450
<parameter>const <link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *id</parameter>);</programlisting>
532
452
</para><variablelist role="params">
533
453
<varlistentry><term><parameter>bag</parameter> :</term>
534
<listitem><simpara> The bag
535
455
</simpara></listitem></varlistentry>
536
456
<varlistentry><term><parameter>indx</parameter> :</term>
537
<listitem><simpara> The bag's element to add the id
538
458
</simpara></listitem></varlistentry>
539
459
<varlistentry><term><parameter>id</parameter> :</term>
540
<listitem><simpara> the ID
541
461
</simpara></listitem></varlistentry>
542
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> On success, <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> is returned, otherwise a
543
negative error value. or a negative value on error.
462
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
545
463
</simpara></listitem></varlistentry>
546
464
</variablelist></refsect2>
547
465
<refsect2 id="gnutls-pkcs12-bag-get-friendly-name" role="function">
548
466
<title>gnutls_pkcs12_bag_get_friendly_name ()</title>
549
<indexterm zone="gnutls-pkcs12-bag-get-friendly-name"><primary sortas="gnutls_pkcs12_bag_get_friendly_name">gnutls_pkcs12_bag_get_friendly_name</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_pkcs12_bag_get_friendly_name (<link linkend="gnutls-pkcs12-bag-t">gnutls_pkcs12_bag_t</link> bag,
550
<link linkend="int">int</link> indx,
551
<link linkend="char">char</link> **name);</programlisting>
553
This function will return the friendly name, of the specified bag element.
554
The key ID is usually used to distinguish the local private key and the certificate pair.</para>
467
<indexterm zone="gnutls-pkcs12-bag-get-friendly-name"><primary>gnutls_pkcs12_bag_get_friendly_name</primary></indexterm>
468
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_pkcs12_bag_get_friendly_name (<parameter><link linkend="gnutls-pkcs12-bag-t"><type>gnutls_pkcs12_bag_t</type></link> bag</parameter>,
469
<parameter><link linkend="int"><type>int</type></link> indx</parameter>,
470
<parameter><link linkend="char"><type>char</type></link> **name</parameter>);</programlisting>
556
472
</para><variablelist role="params">
557
473
<varlistentry><term><parameter>bag</parameter> :</term>
558
<listitem><simpara> The bag
559
475
</simpara></listitem></varlistentry>
560
476
<varlistentry><term><parameter>indx</parameter> :</term>
561
<listitem><simpara> The bag's element to add the id
562
478
</simpara></listitem></varlistentry>
563
479
<varlistentry><term><parameter>name</parameter> :</term>
564
<listitem><simpara> will hold a pointer to the name (to be treated as const)
565
481
</simpara></listitem></varlistentry>
566
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> On success, <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> is returned, otherwise a
567
negative error value. or a negative value on error.
482
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
569
483
</simpara></listitem></varlistentry>
570
484
</variablelist></refsect2>
571
485
<refsect2 id="gnutls-pkcs12-bag-set-friendly-name" role="function">
572
486
<title>gnutls_pkcs12_bag_set_friendly_name ()</title>
573
<indexterm zone="gnutls-pkcs12-bag-set-friendly-name"><primary sortas="gnutls_pkcs12_bag_set_friendly_name">gnutls_pkcs12_bag_set_friendly_name</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_pkcs12_bag_set_friendly_name (<link linkend="gnutls-pkcs12-bag-t">gnutls_pkcs12_bag_t</link> bag,
574
<link linkend="int">int</link> indx,
575
const <link linkend="char">char</link> *name);</programlisting>
577
This function will add the given key friendly name, to the specified, by the index, bag
578
element. The name will be encoded as a 'Friendly name' bag attribute,
579
which is usually used to set a user name to the local private key and the certificate pair.</para>
487
<indexterm zone="gnutls-pkcs12-bag-set-friendly-name"><primary>gnutls_pkcs12_bag_set_friendly_name</primary></indexterm>
488
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_pkcs12_bag_set_friendly_name (<parameter><link linkend="gnutls-pkcs12-bag-t"><type>gnutls_pkcs12_bag_t</type></link> bag</parameter>,
489
<parameter><link linkend="int"><type>int</type></link> indx</parameter>,
490
<parameter>const <link linkend="char"><type>char</type></link> *name</parameter>);</programlisting>
581
492
</para><variablelist role="params">
582
493
<varlistentry><term><parameter>bag</parameter> :</term>
583
<listitem><simpara> The bag
584
495
</simpara></listitem></varlistentry>
585
496
<varlistentry><term><parameter>indx</parameter> :</term>
586
<listitem><simpara> The bag's element to add the id
587
498
</simpara></listitem></varlistentry>
588
499
<varlistentry><term><parameter>name</parameter> :</term>
589
<listitem><simpara> the name
590
501
</simpara></listitem></varlistentry>
591
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> On success, <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> is returned, otherwise a
592
negative error value. or a negative value on error.
502
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
594
503
</simpara></listitem></varlistentry>
595
504
</variablelist></refsect2>