Debian Codegraph @

docs/api_reference/CXX/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>DbEnv::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 DbEnv Handle" />
11 <link rel="prev" href="envset_create_dir.html" title="DbEnv::set_create_dir()" />
12 <link rel="next" href="envevent_notify.html" title="DbEnv::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">DbEnv::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 DbEnv 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>DbEnv::set_encrypt()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db_cxx.h&gt;
42
43 int
44 DbEnv::set_encrypt(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">DbEnv::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 DbEnv Handle">DbEnv</a> handle.
53 </p>
54 <p>
55 The <code class="methodname">DbEnv::set_encrypt()</code> method may not be called after the
56 <a class="xref" href="envopen.html" title="DbEnv::open()">DbEnv::open()</a> method is called.
57 If the database environment already exists when
58 <a class="xref" href="envopen.html" title="DbEnv::open()">DbEnv::open()</a> is called, the
59 information specified to <code class="methodname">DbEnv::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">DbEnv::set_encrypt()</code> <span>
64
65 <span>
66 method either returns a non-zero error value or throws an
67 exception that encapsulates a non-zero error value on
68 failure, and returns 0 on success.
69 </span>
70 </span>
71 </p>
72 <div class="sect2" lang="en" xml:lang="en">
73 <div class="titlepage">
74 <div>
75 <div>
76 <h3 class="title"><a id="idp7245824"></a>Parameters</h3>
77 </div>
78 </div>
79 </div>
80 <div class="sect3" lang="en" xml:lang="en">
81 <div class="titlepage">
82 <div>
83 <div>
84 <h4 class="title"><a id="idp7245672"></a>passwd</h4>
85 </div>
86 </div>
87 </div>
88 <p>
89 The <span class="bold"><strong>passwd</strong></span> parameter is the password
90 used to perform encryption and decryption.
91 </p>
92 </div>
93 <div class="sect3" lang="en" xml:lang="en">
94 <div class="titlepage">
95 <div>
96 <div>
97 <h4 class="title"><a id="idp7210384"></a>flags</h4>
98 </div>
99 </div>
100 </div>
101 <p>
102 The <span class="bold"><strong>flags</strong></span> parameter must be set to 0
103 or the following value:
104 </p>
105 <div class="itemizedlist">
106 <ul type="disc">
107 <li>
108 <p><a id="envset_encrypt_DB_ENCRYPT_AES"></a>
109 <code class="literal">DB_ENCRYPT_AES</code>
110 </p>
111 <p>
112 Use the Rijndael/AES (also known as the Advanced Encryption Standard
113 and Federal Information Processing Standard (FIPS) 197) algorithm for
114 encryption or decryption.
115 </p>
116 </li>
117 </ul>
118 </div>
119 </div>
120 </div>
121 <div class="sect2" lang="en" xml:lang="en">
122 <div class="titlepage">
123 <div>
124 <div>
125 <h3 class="title"><a id="idp7252800"></a>Errors</h3>
126 </div>
127 </div>
128 </div>
129 <p>
130 The <code class="methodname">DbEnv::set_encrypt()</code> <span>
131
132 <span>
133 method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a>
134 exception, encapsulating one of the following non-zero errors, or return one
135 of the following non-zero errors:
136 </span>
137 </span>
138 </p>
139 <div class="sect3" lang="en" xml:lang="en">
140 <div class="titlepage">
141 <div>
142 <div>
143 <h4 class="title"><a id="idp7260416"></a>EINVAL</h4>
144 </div>
145 </div>
146 </div>
147 <p>
148 If the method was called after <a class="xref" href="envopen.html" title="DbEnv::open()">DbEnv::open()</a>
149 was called; or if an invalid flag value or parameter was specified.
150 </p>
151 </div>
152 <div class="sect3" lang="en" xml:lang="en">
153 <div class="titlepage">
154 <div>
155 <div>
156 <h4 class="title"><a id="idp7256928"></a>EOPNOTSUPP</h4>
157 </div>
158 </div>
159 </div>
160 <p>
161 Cryptography is not available in this Berkeley DB release.
162 </p>
163 </div>
164 </div>
165 <div class="sect2" lang="en" xml:lang="en">
166 <div class="titlepage">
167 <div>
168 <div>
169 <h3 class="title"><a id="idp7261280"></a>Class</h3>
170 </div>
171 </div>
172 </div>
173 <p>
174 <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a>
175 </p>
176 </div>
177 <div class="sect2" lang="en" xml:lang="en">
178 <div class="titlepage">
179 <div>
180 <div>
181 <h3 class="title"><a id="idp7250600"></a>See Also</h3>
182 </div>
183 </div>
184 </div>
185 <p>
186 <a class="xref" href="env.html#envlist" title="Database Environments and Related Methods">Database Environments and Related Methods</a>
187 </p>
188 </div>
189 </div>
190 <div class="navfooter">
191 <hr />
192 <table width="100%" summary="Navigation footer">
193 <tr>
194 <td width="40%" align="left"><a accesskey="p" href="envset_create_dir.html">Prev</a> </td>
195 <td width="20%" align="center">
196 <a accesskey="u" href="env.html">Up</a>
197 </td>
198 <td width="40%" align="right"> <a accesskey="n" href="envevent_notify.html">Next</a></td>
199 </tr>
200 <tr>
201 <td width="40%" align="left" valign="top">DbEnv::set_create_dir() </td>
202 <td width="20%" align="center">
203 <a accesskey="h" href="index.html">Home</a>
204 </td>
205 <td width="40%" align="right" valign="top"> DbEnv::set_event_notify()</td>
206 </tr>
207 </table>
208 </div>
209 </body>
210 </html>