Debian Codegraph @

docs/api_reference/CXX/dbset_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::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="db.html" title="Chapter 2.  The Db Handle" />
11 <link rel="prev" href="dbset_dup_compare.html" title="Db::set_dup_compare()" />
12 <link rel="next" href="dbset_errcall.html" title="Db::set_errcall()" />
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::set_encrypt()</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="dbset_dup_compare.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 2. 
26 The Db Handle
27 </th>
28 <td width="20%" align="right"> <a accesskey="n" href="dbset_errcall.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="dbset_encrypt"></a>Db::set_encrypt()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db_cxx.h&gt;
42
43 int
44 Db::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 Because databases opened within Berkeley DB environments use the
51 password specified to the environment, it is an error to attempt to
52 set a password in a database created within an environment.
53 </p>
54 <p>
55 The <code class="methodname">Db::set_encrypt()</code> method may not be called after the
56 <a class="xref" href="dbopen.html" title="Db::open()">Db::open()</a> method is called.
57 </p>
58 <p>
59 The <code class="methodname">Db::set_encrypt()</code> <span>
60
61 <span>
62 method either returns a non-zero error value or throws an
63 exception that encapsulates a non-zero error value on
64 failure, and returns 0 on success.
65 </span>
66 </span>
67 </p>
68 <div class="sect2" lang="en" xml:lang="en">
69 <div class="titlepage">
70 <div>
71 <div>
72 <h3 class="title"><a id="idm717520"></a>Parameters</h3>
73 </div>
74 </div>
75 </div>
76 <div class="sect3" lang="en" xml:lang="en">
77 <div class="titlepage">
78 <div>
79 <div>
80 <h4 class="title"><a id="idm1244320"></a>passwd</h4>
81 </div>
82 </div>
83 </div>
84 <p>
85 The <span class="bold"><strong>passwd</strong></span> parameter is the password
86 used to perform encryption and decryption.
87 </p>
88 </div>
89 <div class="sect3" lang="en" xml:lang="en">
90 <div class="titlepage">
91 <div>
92 <div>
93 <h4 class="title"><a id="idp59640"></a>flags</h4>
94 </div>
95 </div>
96 </div>
97 <p>
98 The <span class="bold"><strong>flags</strong></span> parameter must be set to 0
99 or the following value:
100 </p>
101 <div class="itemizedlist">
102 <ul type="disc">
103 <li>
104 <p><a id="set_encrypt_DB_ENCRYPT_AES"></a>
105 <code class="literal">DB_ENCRYPT_AES</code>
106 </p>
107 <p>
108 Use the Rijndael/AES (also known as the Advanced Encryption Standard
109 and Federal Information Processing Standard (FIPS) 197) algorithm for
110 encryption or decryption.
111 </p>
112 </li>
113 </ul>
114 </div>
115 </div>
116 </div>
117 <div class="sect2" lang="en" xml:lang="en">
118 <div class="titlepage">
119 <div>
120 <div>
121 <h3 class="title"><a id="idm1643440"></a>Errors</h3>
122 </div>
123 </div>
124 </div>
125 <p>
126 The <code class="methodname">Db::set_encrypt()</code> <span>
127
128 <span>
129 method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a>
130 exception, encapsulating one of the following non-zero errors, or return one
131 of the following non-zero errors:
132 </span>
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="idp2686544"></a>EINVAL</h4>
140 </div>
141 </div>
142 </div>
143 <p>
144 If the method was called after <a class="xref" href="dbopen.html" title="Db::open()">Db::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="idm2185912"></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="idm1975472"></a>Class</h3>
166 </div>
167 </div>
168 </div>
169 <p>
170 <a class="link" href="db.html" title="Chapter 2.  The Db Handle">Db</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="idm1847016"></a>See Also</h3>
178 </div>
179 </div>
180 </div>
181 <p>
182 <a class="xref" href="db.html#dblist" title="Database and Related Methods">Database 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="dbset_dup_compare.html">Prev</a> </td>
191 <td width="20%" align="center">
192 <a accesskey="u" href="db.html">Up</a>
193 </td>
194 <td width="40%" align="right"> <a accesskey="n" href="dbset_errcall.html">Next</a></td>
195 </tr>
196 <tr>
197 <td width="40%" align="left" valign="top">Db::set_dup_compare() </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::set_errcall()</td>
202 </tr>
203 </table>
204 </div>
205 </body>
206 </html>