-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathopenpgp.d.ts
70 lines (67 loc) · 1.93 KB
/
openpgp.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
declare module 'openpgp' {
namespace config {
var commentstring: string;
var show_comment: boolean;
var show_version: boolean;
}
class Keyid {
bytes: string;
read(bytes: Uint8Array): Keyid;
write(): Uint16Array;
toHex(): string;
}
class SessionKey { data: Uint8Array; algorithm: String }
namespace packet {
class Signature {
isExpired(date: Date): boolean;
}
class PublicKey {
created: Date;
read(bytes: Uint8Array): PublicKey;
write(): Uint8Array;
getKeyId(): Keyid;
getFingerprint(): string;
getAlgorithmInfo(): { algorithm: string, bits: number };
}
class PublicSubkey extends PublicKey {
}
}
class Message { }
namespace key {
function readArmored(armoredText: string): {
keys: Array<key.Key>
err?: Array<Error>
};
class User { }
class Key {
getExpirationTime(): Promise<Date>
getPrimaryUser(date?: Date): { user: key.User, selfCertification: packet.Signature };
getUserIds(): Array<string>;
isPrivate(): boolean;
primaryKey: packet.PublicKey;
subKeys: Array<SubKey>
}
class SubKey {
subKey: packet.PublicSubkey;
}
}
function encrypt(args: {
data: string | Uint8Array,
publicKeys?: key.Key | Array<key.Key>,
privateKeys?: key.Key | Array<key.Key>,
passwords?: string | Array<string>,
sessionKey?: SessionKey,
filename?: string,
compression?: any,
armor?: boolean,
detached?: boolean,
signature?: any,
returnSessionKey?: boolean,
wildcard?: boolean,
date?: Date
}): Promise<{
data?: string,
message?: Message,
signature?: packet.Signature
}>;
}