• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt/router/db-4.8.30/docs/api_reference/C/
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 class="navheader">
16      <table width="100%" summary="Navigation header">
17        <tr>
18          <th colspan="3" align="center">DB_ENV-&gt;set_encrypt()</th>
19        </tr>
20        <tr>
21          <td width="20%" align="left"><a accesskey="p" href="envset_create_dir.html">Prev</a>��</td>
22          <th width="60%" align="center">Chapter��5.��
23                The DB_ENV Handle
24        </th>
25          <td width="20%" align="right">��<a accesskey="n" href="envevent_notify.html">Next</a></td>
26        </tr>
27      </table>
28      <hr />
29    </div>
30    <div class="sect1" lang="en" xml:lang="en">
31      <div class="titlepage">
32        <div>
33          <div>
34            <h2 class="title" style="clear: both"><a id="envset_encrypt"></a>DB_ENV-&gt;set_encrypt()</h2>
35          </div>
36        </div>
37      </div>
38      <pre class="programlisting">#include &lt;db.h&gt;
39
40int
41DB_ENV-&gt;set_encrypt(DB_ENV *dbenv, const char *passwd, u_int32_t flags);  </pre>
42      <p>
43         Set the password used by the Berkeley DB library to perform encryption
44         and decryption.
45    </p>
46      <p>
47         The <code class="methodname">DB_ENV-&gt;set_encrypt()</code> method configures a database environment,
48         not only operations performed using the specified 
49         <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a>  handle.
50    </p>
51      <p>
52         The <code class="methodname">DB_ENV-&gt;set_encrypt()</code> method may not be called after the 
53         <a class="xref" href="envopen.html" title="DB_ENV-&gt;open()">DB_ENV-&gt;open()</a>  method is called.
54         If the database environment already exists when 
55         <a class="xref" href="envopen.html" title="DB_ENV-&gt;open()">DB_ENV-&gt;open()</a>  is called, the
56         information specified to <code class="methodname">DB_ENV-&gt;set_encrypt()</code> must be consistent
57         with the existing environment or an error will be returned.
58    </p>
59      <p>
60         The <code class="methodname">DB_ENV-&gt;set_encrypt()</code> <span>
61            <span>
62                  method returns a non-zero error value on failure and 0 on success.
63            </span>
64            
65        </span>
66    </p>
67      <div class="sect2" lang="en" xml:lang="en">
68        <div class="titlepage">
69          <div>
70            <div>
71              <h3 class="title"><a id="id1667665"></a>Parameters</h3>
72            </div>
73          </div>
74        </div>
75        <div class="sect3" lang="en" xml:lang="en">
76          <div class="titlepage">
77            <div>
78              <div>
79                <h4 class="title"><a id="id1667701"></a>flags</h4>
80              </div>
81            </div>
82          </div>
83          <p>
84                          The <span class="bold"><strong>flags</strong></span> parameter must be set to 0
85                          or the following value:
86                     </p>
87          <div class="itemizedlist">
88            <ul type="disc">
89              <li>
90                <p><a id="set_encrypt_DB_ENCRYPT_AES"></a>
91                  <code class="literal">DB_ENCRYPT_AES</code>
92            </p>
93                <p>
94                 Use the Rijndael/AES (also known as the Advanced Encryption Standard
95                 and Federal Information Processing Standard (FIPS) 197) algorithm for
96                 encryption or decryption.
97            </p>
98              </li>
99            </ul>
100          </div>
101        </div>
102        <div class="sect3" lang="en" xml:lang="en">
103          <div class="titlepage">
104            <div>
105              <div>
106                <h4 class="title"><a id="id1667866"></a>passwd</h4>
107              </div>
108            </div>
109          </div>
110          <p>
111                          The <span class="bold"><strong>passwd</strong></span> parameter is the password
112                          used to perform encryption and decryption.
113                     </p>
114        </div>
115      </div>
116      <div class="sect2" lang="en" xml:lang="en">
117        <div class="titlepage">
118          <div>
119            <div>
120              <h3 class="title"><a id="id1668005"></a>Errors</h3>
121            </div>
122          </div>
123        </div>
124        <p>
125                         The <code class="methodname">DB_ENV-&gt;set_encrypt()</code> <span>
126            <span>
127                 method may fail and return one of the following non-zero errors:
128            </span>
129            
130        </span>
131                    </p>
132        <div class="sect3" lang="en" xml:lang="en">
133          <div class="titlepage">
134            <div>
135              <div>
136                <h4 class="title"><a id="id1667892"></a>EINVAL</h4>
137              </div>
138            </div>
139          </div>
140          <p>
141                If the method was called after <a class="xref" href="envopen.html" title="DB_ENV-&gt;open()">DB_ENV-&gt;open()</a> 
142                was called; or if an invalid flag value or parameter was specified.
143            </p>
144        </div>
145        <div class="sect3" lang="en" xml:lang="en">
146          <div class="titlepage">
147            <div>
148              <div>
149                <h4 class="title"><a id="id1667669"></a>EOPNOTSUPP</h4>
150              </div>
151            </div>
152          </div>
153          <p>
154                Cryptography is not available in this Berkeley DB release.
155            </p>
156        </div>
157      </div>
158      <div class="sect2" lang="en" xml:lang="en">
159        <div class="titlepage">
160          <div>
161            <div>
162              <h3 class="title"><a id="id1667695"></a>Class</h3>
163            </div>
164          </div>
165        </div>
166        <p>
167                <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a>  
168            </p>
169      </div>
170      <div class="sect2" lang="en" xml:lang="en">
171        <div class="titlepage">
172          <div>
173            <div>
174              <h3 class="title"><a id="id1667938"></a>See Also</h3>
175            </div>
176          </div>
177        </div>
178        <p>
179                     <a class="xref" href="env.html#envlist" title="Database Environments and Related Methods">Database Environments and Related Methods</a> 
180                </p>
181      </div>
182    </div>
183    <div class="navfooter">
184      <hr />
185      <table width="100%" summary="Navigation footer">
186        <tr>
187          <td width="40%" align="left"><a accesskey="p" href="envset_create_dir.html">Prev</a>��</td>
188          <td width="20%" align="center">
189            <a accesskey="u" href="env.html">Up</a>
190          </td>
191          <td width="40%" align="right">��<a accesskey="n" href="envevent_notify.html">Next</a></td>
192        </tr>
193        <tr>
194          <td width="40%" align="left" valign="top">DB_ENV-&gt;set_create_dir()��</td>
195          <td width="20%" align="center">
196            <a accesskey="h" href="index.html">Home</a>
197          </td>
198          <td width="40%" align="right" valign="top">��DB_ENV-&gt;set_event_notify()</td>
199        </tr>
200      </table>
201    </div>
202  </body>
203</html>
204