-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
105 lines (102 loc) · 3.93 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
type SQLCipherHashAlgorithm = "sha1" | "sha256" | "sha512";
type SQLCipherConfiguration = {
kdf_iterations: number,
kdf_algorithm: SQLCipherHashAlgorithm,
hmac_algorithm: SQLCipherHashAlgorithm
}
/** The default configuration for SQLCipher 3 */
export const SQLCIPHER3 : SQLCipherConfiguration;
/** The default configuration for SQLCipher 4 */
export const SQLCIPHER4 : SQLCipherConfiguration;
/**
* Decrypts a database
* @param buffer The database's contents
* @param password The password
* @param configuration The configuration
* @returns The decrypted database's contents
*/
export function decrypt(buffer: Buffer, password: string, configuration: SQLCipherConfiguration): Buffer;
/**
* Decrypts a database
* @param buffer The database's contents
* @param key The raw key
* @param configuration The configuration
* @returns The decrypted database's contents
*/
export function decrypt(buffer: Buffer, key: Buffer, configuration: SQLCipherConfiguration): Buffer;
/**
* Decrypts a database file
* @param path The database's path
* @param password The password
* @param configuration The configuration
*/
export function decryptFile(path: string, password: string, configuration: SQLCipherConfiguration): void;
/**
* Decrypts a database file
* @param path The database's path
* @param key The raw key
* @param configuration The configuration
*/
export function decryptFile(path: string, key: Buffer, configuration: SQLCipherConfiguration): void;
/**
* Decrypts a database file
* @param inputPath The encrypted database's path
* @param outputPath The path to store the decrypted database
* @param password The password
* @param configuration The configuration
*/
export function decryptFile(inputPath: string, outputPath: string, password: string, configuration: SQLCipherConfiguration): void;
/**
* Decrypts a database file
* @param inputPath The encrypted database's path
* @param outputPath The path to store the decrypted database
* @param key The raw key
* @param configuration The configuration
*/
export function decryptFile(inputPath: string, outputPath: string, key: Buffer, configuration: SQLCipherConfiguration): void;
/**
* Encrypts a database
* @param buffer The database's contents
* @param password The password
* @param configuration The configuration
* @returns The encrypted database's contents
*/
export function encrypt(buffer: Buffer, password: string, configuration: SQLCipherConfiguration): Buffer;
/**
* Encrypts a database
* @param buffer The database's contents
* @param key The raw key
* @param configuration The configuration
* @returns The encrypted database's contents
*/
export function encrypt(buffer: Buffer, key: Buffer, configuration: SQLCipherConfiguration): Buffer;
/**
* Encrypts a database file
* @param path The database's path
* @param password The password
* @param configuration The configuration
*/
export function encryptFile(path: string, password: string, configuration: SQLCipherConfiguration): void;
/**
* Encrypts a database file
* @param path The database's path
* @param key The raw key
* @param configuration The configuration
*/
export function encryptFile(path: string, key: Buffer, configuration: SQLCipherConfiguration): void;
/**
* Encrypts a database file
* @param inputPath The database's path
* @param outputPath The path to store the encrypted database
* @param password The password
* @param configuration The configuration
*/
export function encryptFile(inputPath: string, outputPath: string, password: string, configuration: SQLCipherConfiguration): void;
/**
* Encrypts a database file
* @param inputPath The database's path
* @param outputPath The path to store the encrypted database
* @param key The raw key
* @param configuration The configuration
*/
export function encryptFile(inputPath: string, outputPath: string, key: Buffer, configuration: SQLCipherConfiguration): void;