forked from freedomjs/freedom-pgp-e2e
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpgpapi.json
119 lines (107 loc) · 3.52 KB
/
pgpapi.json
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
{
"name": "e2e",
"description": "End-to-end Freedom manifest",
"app": {
"script": [
"end-to-end.compiled.js",
"googstorage.js",
"hex2words.js",
"e2e.js"
]
},
"constraints": {
"isolation": "never"
},
"provides" : [
"crypto"
],
"default": "crypto",
"api": {
"crypto": {
"_comment": "Simplified crypto interface",
"ERRCODE": { "type": "constant", "value": {
"KEYS_NOT_LOADED": "No keys in memory - initialize first",
"MALFORMED": "Malformed armored message",
"INVALID_PASSPHRASE": "Wrong passphrase",
"KEY_NOT_GENERATED": "Trying to generate key, but it already exists",
"KEY_DOES_NOT_EXIST": "Trying to load a key that's not there",
"BAD_SIGNATURE": "Invalid signature on call to verify"
}},
"setup": {
"_comment": "Creates a new keypair or loads one if it already exists",
"type": "method",
"value": ["string", "string"],
"ret": [],
"err": { "errcode": "string", "message": "string" }
},
"clear": {
"_comment": "Clear local storage, resetting private key",
"type": "method",
"value": [],
"ret": [],
"err": { "errcode": "string", "message": "string" }
},
"importKeypair": {
"_comment": "Import a public/private keypair, overwriting if needed",
"type": "method",
"value": ["string", "string", "string"],
"ret": [],
"err": { "errcode": "string", "message": "string" }
},
"exportKey": {
"_comment": "Export your public key and fingerprint to share/check",
"type": "method",
"value": ["boolean"],
"ret": { "key": "string", "fingerprint": "string",
"words": ["array", "string"] },
"err": { "errcode": "string", "message": "string" }
},
"getFingerprint": {
"_comment": "Calculate and return 20-byte public key fingerprint",
"type": "method",
"value": ["string"],
"ret": { "fingerprint": "string", "words": ["array", "string"] },
"err": { "errcode": "string", "message": "string" }
},
"signEncrypt": {
"_comment": "Sign w/private key, optionally encrypt with other key",
"type": "method",
"value": ["buffer", "string", "boolean"],
"ret": "buffer",
"err": { "errcode": "string", "message": "string" }
},
"verifyDecrypt": {
"_comment": "Decrypt w/private key, optionally verify with other key",
"type": "method",
"value": ["buffer", "string"],
"ret": { "data": "buffer", "signedBy": ["array", "string"] },
"err": { "errcode": "string", "message": "string" }
},
"armor": {
"_comment": "ASCII armor data, and include given header",
"type": "method",
"value": ["buffer", "string"],
"ret": "string",
"err": { "errcode": "string", "message": "string" }
},
"dearmor": {
"_comment": "De-armor given data, checking for given header",
"type": "method",
"value": ["string"],
"ret": "buffer",
"err": { "errcode": "string", "message": "string" }
},
"ecdhBob": {
"_comment": "Full elliptical curve implementation in a single function",
"type": "method",
"value": ["string", "string"],
"ret": "buffer",
"err": { "errcode": "string", "message": "string" }
}
}
},
"permissions": [
"core.crypto",
"core.storage"
]
}