@@ -110,6 +110,8 @@ Task<CreateTablesResult> CreateTablesAsync<T, T2, T3, T4, T5> (CreateFlags creat
110
110
Task < List < T > > QueryAsync < T > ( string query , params object [ ] args ) where T : new ( ) ;
111
111
Task < List < object > > QueryAsync ( TableMapping map , string query , params object [ ] args ) ;
112
112
Task < List < T > > QueryScalarsAsync < T > ( string query , params object [ ] args ) ;
113
+ Task ReKeyAsync ( string key ) ;
114
+ Task ReKeyAsync ( byte [ ] key ) ;
113
115
Task RunInTransactionAsync ( Action < SQLiteConnection > action ) ;
114
116
Task SetBusyTimeoutAsync ( TimeSpan value ) ;
115
117
AsyncTableQuery < T > Table < T > ( ) where T : new ( ) ;
@@ -121,8 +123,7 @@ Task<CreateTablesResult> CreateTablesAsync<T, T2, T3, T4, T5> (CreateFlags creat
121
123
/// <summary>
122
124
/// A pooled asynchronous connection to a SQLite database.
123
125
/// </summary>
124
- public partial class SQLiteAsyncConnection
125
- : ISQLiteAsyncConnection
126
+ public partial class SQLiteAsyncConnection : ISQLiteAsyncConnection
126
127
{
127
128
readonly SQLiteConnectionString _connectionString ;
128
129
@@ -1265,6 +1266,30 @@ public Task<IEnumerable<object>> DeferredQueryAsync (TableMapping map, string qu
1265
1266
{
1266
1267
return ReadAsync ( conn => ( IEnumerable < object > ) conn . DeferredQuery ( map , query , args ) . ToList ( ) ) ;
1267
1268
}
1269
+
1270
+ /// <summary>
1271
+ /// Change the encryption key for a SQLCipher database with "pragma rekey = ...".
1272
+ /// </summary>
1273
+ /// <param name="key">Encryption key plain text that is converted to the real encryption key using PBKDF2 key derivation</param>
1274
+ public Task ReKeyAsync ( string key )
1275
+ {
1276
+ return WriteAsync < object > ( conn => {
1277
+ conn . ReKey ( key ) ;
1278
+ return null ;
1279
+ } ) ;
1280
+ }
1281
+
1282
+ /// <summary>
1283
+ /// Change the encryption key for a SQLCipher database.
1284
+ /// </summary>
1285
+ /// <param name="key">256-bit (32 byte) or 384-bit (48 bytes) encryption key data</param>
1286
+ public Task ReKeyAsync ( byte [ ] key )
1287
+ {
1288
+ return WriteAsync < object > ( conn => {
1289
+ conn . ReKey ( key ) ;
1290
+ return null ;
1291
+ } ) ;
1292
+ }
1268
1293
}
1269
1294
1270
1295
/// <summary>
0 commit comments