@@ -110,6 +110,8 @@ Task<CreateTablesResult> CreateTablesAsync<T, T2, T3, T4, T5> (CreateFlags creat
110110 Task < List < T > > QueryAsync < T > ( string query , params object [ ] args ) where T : new ( ) ;
111111 Task < List < object > > QueryAsync ( TableMapping map , string query , params object [ ] args ) ;
112112 Task < List < T > > QueryScalarsAsync < T > ( string query , params object [ ] args ) ;
113+ Task ReKeyAsync ( string key ) ;
114+ Task ReKeyAsync ( byte [ ] key ) ;
113115 Task RunInTransactionAsync ( Action < SQLiteConnection > action ) ;
114116 Task SetBusyTimeoutAsync ( TimeSpan value ) ;
115117 AsyncTableQuery < T > Table < T > ( ) where T : new ( ) ;
@@ -121,8 +123,7 @@ Task<CreateTablesResult> CreateTablesAsync<T, T2, T3, T4, T5> (CreateFlags creat
121123 /// <summary>
122124 /// A pooled asynchronous connection to a SQLite database.
123125 /// </summary>
124- public partial class SQLiteAsyncConnection
125- : ISQLiteAsyncConnection
126+ public partial class SQLiteAsyncConnection : ISQLiteAsyncConnection
126127 {
127128 readonly SQLiteConnectionString _connectionString ;
128129
@@ -1265,6 +1266,30 @@ public Task<IEnumerable<object>> DeferredQueryAsync (TableMapping map, string qu
12651266 {
12661267 return ReadAsync ( conn => ( IEnumerable < object > ) conn . DeferredQuery ( map , query , args ) . ToList ( ) ) ;
12671268 }
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+ }
12681293 }
12691294
12701295 /// <summary>
0 commit comments