-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathindex.d.ts
60 lines (53 loc) · 1.36 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
import {
ICrypto as ICryptoBase,
IBrainKeyCrypto,
NodeBuffer,
IPublicKey,
IPrivateKey
} from "@virgilsecurity/crypto-types";
export type EncryptFileParams = {
inputPath: string;
publicKeys: IPublicKey | IPublicKey[];
outputPath?: string;
enablePadding?: boolean;
};
export type DecryptFileParams = {
inputPath: string;
privateKey: IPrivateKey;
outputPath?: string;
};
export type GenerateFileSignatureParams = {
inputPath: string;
privateKey: IPrivateKey;
};
export type VerifyFileSignatureParams = {
inputPath: string;
signature: string;
publicKey: IPublicKey;
};
interface ICrypto extends ICryptoBase {
encryptFile(params: EncryptFileParams): Promise<string>;
decryptFile(params: DecryptFileParams): Promise<string>;
generateFileSignature(params: GenerateFileSignatureParams): Promise<NodeBuffer>;
verifyFileSignature(params: VerifyFileSignatureParams): Promise<boolean>;
}
export const Buffer: NodeBuffer;
export const virgilCrypto: ICrypto;
export const virgilBrainKeyCrypto: IBrainKeyCrypto;
export enum KeyPairType {
ED25519,
CURVE25519,
SECP256R1,
RSA_2048,
RSA_4096,
RSA_8192,
CURVE25519_ED25519,
CURVE25519_ROUND5_ED25519_FALCON
}
export enum HashAlgorithm {
SHA224,
SHA256,
SHA384,
SHA512
}
export { IKeyPair } from "@virgilsecurity/crypto-types";