Debian Codegraph @

docs/api_reference/C/envset_encrypt.html

raw symbols SCIP
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6 <title>DB_ENV-&gt;set_encrypt()</title>
7 <link rel="stylesheet" href="apiReference.css" type="text/css" />
8 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
9 <link rel="start" href="index.html" title="Berkeley DB C API Reference" />
10 <link rel="up" href="env.html" title="Chapter 5.  The DB_ENV Handle" />
11 <link rel="prev" href="envset_create_dir.html" title="DB_ENV-&gt;set_create_dir()" />
12 <link rel="next" href="envevent_notify.html" title="DB_ENV-&gt;set_event_notify()" />
13 </head>
14 <body>
15 <div xmlns="" class="navheader">
16 <div class="libver">
17 <p>Library Version 11.2.5.3</p>
18 </div>
19 <table width="100%" summary="Navigation header">
20 <tr>
21 <th colspan="3" align="center">DB_ENV-&gt;set_encrypt()</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="envset_create_dir.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 5. 
26 The DB_ENV Handle
27 </th>
28 <td width="20%" align="right"> <a accesskey="n" href="envevent_notify.html">Next</a></td>
29 </tr>
30 </table>
31 <hr />
32 </div>
33 <div class="sect1" lang="en" xml:lang="en">
34 <div class="titlepage">
35 <div>
36 <div>
37 <h2 class="title" style="clear: both"><a id="envset_encrypt"></a>DB_ENV-&gt;set_encrypt()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db.h&gt;
42
43 int
44 DB_ENV-&gt;set_encrypt(DB_ENV *dbenv, const char *passwd, u_int32_t flags); </pre>
45 <p>
46 Set the password used by the Berkeley DB library to perform encryption
47 and decryption.
48 </p>
49 <p>
50 The <code class="methodname">DB_ENV-&gt;set_encrypt()</code> method configures a database environment,
51 not only operations performed using the specified
52 <a class="link" href="env.html" title="Chapter 5.  The DB_ENV Handle">DB_ENV</a> handle.
53 </p>
54 <p>
55 The <code class="methodname">DB_ENV-&gt;set_encrypt()</code> method may not be called after the
56 <a class="xref" href="envopen.html" title="DB_ENV-&gt;open()">DB_ENV-&gt;open()</a> method is called.
57 If the database environment already exists when
58 <a class="xref" href="envopen.html" title="DB_ENV-&gt;open()">DB_ENV-&gt;open()</a> is called, the
59 information specified to <code class="methodname">DB_ENV-&gt;set_encrypt()</code> must be consistent
60 with the existing environment or an error will be returned.
61 </p>
62 <p>
63 The <code class="methodname">DB_ENV-&gt;set_encrypt()</code> <span>
64 <span>
65 method returns a non-zero error value on failure and 0 on success.
66 </span>
67
68 </span>
69 </p>
70 <div class="sect2" lang="en" xml:lang="en">
71 <div class="titlepage">
72 <div>
73 <div>
74 <h3 class="title"><a id="idp51907568"></a>Parameters</h3>
75 </div>
76 </div>
77 </div>
78 <div class="sect3" lang="en" xml:lang="en">
79 <div class="titlepage">
80 <div>
81 <div>
82 <h4 class="title"><a id="idp51895392"></a>passwd</h4>
83 </div>
84 </div>
85 </div>
86 <p>
87 The <span class="bold"><strong>passwd</strong></span> parameter is the password
88 used to perform encryption and decryption.
89 </p>
90 </div>
91 <div class="sect3" lang="en" xml:lang="en">
92 <div class="titlepage">
93 <div>
94 <div>
95 <h4 class="title"><a id="idp51899576"></a>flags</h4>
96 </div>
97 </div>
98 </div>
99 <p>
100 The <span class="bold"><strong>flags</strong></span> parameter must be set to 0
101 or the following value:
102 </p>
103 <div class="itemizedlist">
104 <ul type="disc">
105 <li>
106 <p><a id="envset_encrypt_DB_ENCRYPT_AES"></a>
107 <code class="literal">DB_ENCRYPT_AES</code>
108 </p>
109 <p>
110 Use the Rijndael/AES (also known as the Advanced Encryption Standard
111 and Federal Information Processing Standard (FIPS) 197) algorithm for
112 encryption or decryption.
113 </p>
114 </li>
115 </ul>
116 </div>
117 </div>
118 </div>
119 <div class="sect2" lang="en" xml:lang="en">
120 <div class="titlepage">
121 <div>
122 <div>
123 <h3 class="title"><a id="idp51917160"></a>Errors</h3>
124 </div>
125 </div>
126 </div>
127 <p>
128 The <code class="methodname">DB_ENV-&gt;set_encrypt()</code> <span>
129 <span>
130 method may fail and return one of the following non-zero errors:
131 </span>
132
133 </span>
134 </p>
135 <div class="sect3" lang="en" xml:lang="en">
136 <div class="titlepage">
137 <div>
138 <div>
139 <h4 class="title"><a id="idp51921608"></a>EINVAL</h4>
140 </div>
141 </div>
142 </div>
143 <p>
144 If the method was called after <a class="xref" href="envopen.html" title="DB_ENV-&gt;open()">DB_ENV-&gt;open()</a>
145 was called; or if an invalid flag value or parameter was specified.
146 </p>
147 </div>
148 <div class="sect3" lang="en" xml:lang="en">
149 <div class="titlepage">
150 <div>
151 <div>
152 <h4 class="title"><a id="idp51922688"></a>EOPNOTSUPP</h4>
153 </div>
154 </div>
155 </div>
156 <p>
157 Cryptography is not available in this Berkeley DB release.
158 </p>
159 </div>
160 </div>
161 <div class="sect2" lang="en" xml:lang="en">
162 <div class="titlepage">
163 <div>
164 <div>
165 <h3 class="title"><a id="idp51919664"></a>Class</h3>
166 </div>
167 </div>
168 </div>
169 <p>
170 <a class="link" href="env.html" title="Chapter 5.  The DB_ENV Handle">DB_ENV</a>
171 </p>
172 </div>
173 <div class="sect2" lang="en" xml:lang="en">
174 <div class="titlepage">
175 <div>
176 <div>
177 <h3 class="title"><a id="idp51924016"></a>See Also</h3>
178 </div>
179 </div>
180 </div>
181 <p>
182 <a class="xref" href="env.html#envlist" title="Database Environments and Related Methods">Database Environments and Related Methods</a>
183 </p>
184 </div>
185 </div>
186 <div class="navfooter">
187 <hr />
188 <table width="100%" summary="Navigation footer">
189 <tr>
190 <td width="40%" align="left"><a accesskey="p" href="envset_create_dir.html">Prev</a> </td>
191 <td width="20%" align="center">
192 <a accesskey="u" href="env.html">Up</a>
193 </td>
194 <td width="40%" align="right"> <a accesskey="n" href="envevent_notify.html">Next</a></td>
195 </tr>
196 <tr>
197 <td width="40%" align="left" valign="top">DB_ENV-&gt;set_create_dir() </td>
198 <td width="20%" align="center">
199 <a accesskey="h" href="index.html">Home</a>
200 </td>
201 <td width="40%" align="right" valign="top"> DB_ENV-&gt;set_event_notify()</td>
202 </tr>
203 </table>
204 </div>
205 </body>
206 </html>