forked from amitaymolko/react-native-rsa-native
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
29 lines (25 loc) · 1.13 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
declare module 'react-native-rsa-native' {
interface PublicKey {
public: string;
}
interface KeyPair extends PublicKey {
private: string;
}
namespace RSA {
export function generateKeys(keySize: number): Promise<KeyPair>;
export function encrypt(data: string, key: string): Promise<string>;
export function decrypt(data: string, key: string): Promise<string>;
export function sign(data: string, key: string): Promise<string>;
export function verify(data: string, secretToVerify: string, key: string): Promise<boolean>;
}
namespace RSAKeychain {
export function generateKeys(keyTag: string, keySize: number): Promise<PublicKey>;
export function deletePrivateKey(keyTag: string): Promise<boolean>;
export function encrypt(data: string, keyTag: string): Promise<string>;
export function decrypt(data: string, keyTag: string): Promise<string>;
export function sign(data: string, keyTag: string): Promise<string>;
export function verify(data: string, secretToVerify: string, keyTag: string): Promise<boolean>;
export function getPublicKey(keyTag: string): Promise<string | undefined>;
}
export { RSA, RSAKeychain };
}