-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
66 lines (58 loc) · 1.69 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
declare class AasaamAES {
/**
* Binary encryption key
*
* @var {Buffer}
*/
private key: Buffer;
/**
* Create instance
*
* @param {string} key Base64 encoded random bytes with length 32
*/
constructor(key: string);
/**
* Generate encryption key
*
* @return {string} Base64 encoded random bytes with length 32
*/
public static generateKey(): string;
/**
* Generate encryption key for special props
*
* @param {string} key Original encryption key
* @param {string[]} props Array of properties, orders matters
* @return {string} Base64 encoded hash key
*/
public static generateHashKey(key: string, props: string[]): string
/**
* Encrypt message with time to live
*
* @param {string} message Message to be encrypted
* @param {number} ttl number of time to live in second
* @return {string} Encrypted message with time to live
*/
public encryptTTL(message: string, ttl: number): string;
/**
* Decrypted message that contain time to live
*
* @param {string} encryptedTTLMessage Encrypted message with time to live
* @return {string} Original message or empty string on failure
*/
public decryptTTL(encryptedTTLMessage: string): string;
/**
* Encrypt message
*
* @param {string} message Message to be encrypted
* @return {string} Encrypted message
*/
public encrypt(message: string): string;
/**
* Decrypt message
*
* @param {string} encryptedMessage Encrypted message
* @return {string} Original message or empty string on failure
*/
public decrypt(encryptedMessage: string): string;
}
export default AasaamAES;