aboutsummaryrefslogtreecommitdiffstats
path: root/lang/js/src/permittedOperations.js
diff options
context:
space:
mode:
authorMaximilian Krambach <[email protected]>2018-05-28 15:26:56 +0000
committerMaximilian Krambach <[email protected]>2018-05-28 15:26:56 +0000
commit53ce2b94bc35243710dec9b7972c7aaaa79dbc75 (patch)
tree3cf99970812a21d5e4c57afcb39a2b0c67212269 /lang/js/src/permittedOperations.js
parentjs: Treat a connection as a gpgme Context (diff)
downloadgpgme-53ce2b94bc35243710dec9b7972c7aaaa79dbc75.tar.gz
gpgme-53ce2b94bc35243710dec9b7972c7aaaa79dbc75.zip
js: Keyring listing keys
-- * implementing Keyring methods: - Keyring.getKeys: has an additional option that retrieves the armor and secret state once at the beginning. This is power hungry, but allows for Keys to be used directly (without querying gpgme-json each call) * permittedOperations.js: reflect recent changes in the native counterpart, adding more options * Key: adding two methods for retrieving the armored Key block and for finding out if the Key includes a secret subkey.
Diffstat (limited to '')
-rw-r--r--lang/js/src/permittedOperations.js174
1 files changed, 110 insertions, 64 deletions
diff --git a/lang/js/src/permittedOperations.js b/lang/js/src/permittedOperations.js
index 42213ec3..e4f9bd22 100644
--- a/lang/js/src/permittedOperations.js
+++ b/lang/js/src/permittedOperations.js
@@ -45,6 +45,7 @@
export const permittedOperations = {
encrypt: {
+ pinentry: true, //TODO only with signing_keys
required: {
'keys': {
allowed: ['string'],
@@ -59,38 +60,42 @@ export const permittedOperations = {
allowed: ['string'],
allowed_data: ['cms', 'openpgp']
},
- 'chunksize': {
+ 'signing_keys': {
+ allowed: ['string'],
+ array_allowed: true
+ },
+ 'chunksize': {
allowed: ['number']
- },
- 'base64': {
- allowed: ['boolean']
- },
- 'mime': {
- allowed: ['boolean']
- },
- 'armor': {
- allowed: ['boolean']
- },
- 'always-trust': {
- allowed: ['boolean']
- },
- 'no-encrypt-to': {
- allowed: ['string'],
- array_allowed: true
- },
- 'no-compress': {
- allowed: ['boolean']
- },
- 'throw-keyids': {
- allowed: ['boolean']
- },
- 'want-address': {
- allowed: ['boolean']
- },
- 'wrap': {
- allowed: ['boolean']
- },
},
+ 'base64': {
+ allowed: ['boolean']
+ },
+ 'mime': {
+ allowed: ['boolean']
+ },
+ 'armor': {
+ allowed: ['boolean']
+ },
+ 'always-trust': {
+ allowed: ['boolean']
+ },
+ 'no-encrypt-to': {
+ allowed: ['string'],
+ array_allowed: true
+ },
+ 'no-compress': {
+ allowed: ['boolean']
+ },
+ 'throw-keyids': {
+ allowed: ['boolean']
+ },
+ 'want-address': {
+ allowed: ['boolean']
+ },
+ 'wrap': {
+ allowed: ['boolean']
+ }
+ },
answer: {
type: ['ciphertext'],
data: ['data'],
@@ -122,12 +127,7 @@ export const permittedOperations = {
type: ['plaintext'],
data: ['data'],
params: ['base64', 'mime'],
- infos: [] // TODO pending. Info about signatures and validity
- //{
- //signatures: [{
- //Key : <String>Fingerprint,
- //valid: <Boolean>
- // }]
+ infos: ['signatures']
}
},
@@ -208,61 +208,107 @@ export const permittedOperations = {
'validate': {
allowed: ['boolean']
},
- // 'pattern': { TODO
- // allowed: ['string']
- // },
'keys': {
allowed: ['string'],
array_allowed: true
}
},
answer: {
- type: [],
+ type: ['keys'],
data: [],
- params: [],
+ params: ['base64'],
infos: ['keys']
}
},
- /**
- importkey: {
+ export: {
+ required: {},
+ optional: {
+ 'protocol': {
+ allowed: ['string'],
+ allowed_data: ['cms', 'openpgp']
+ },
+ 'chunksize': {
+ allowed: ['number'],
+ },
+ 'keys': {
+ allowed: ['string'],
+ array_allowed: true
+ },
+ 'armor': {
+ allowed: ['boolean']
+ },
+ 'extern': {
+ allowed: ['boolean']
+ },
+ 'minimal': {
+ allowed: ['boolean']
+ },
+ 'raw': {
+ allowed: ['boolean']
+ },
+ 'pkcs12':{
+ allowed: ['boolean']
+ }
+ // secret: not yet implemented
+ },
+ answer: {
+ type: ['keys'],
+ data: ['data'],
+ params: ['base64']
+ }
+ },
+
+ import: {
required: {
- 'keyarmored': {
+ 'data': {
allowed: ['string']
}
},
+ optional: {
+ 'protocol': {
+ allowed: ['string'],
+ allowed_data: ['cms', 'openpgp']
+ },
+ 'base64': {
+ allowed: ['boolean']
+ },
+ },
answer: {
- type: ['TBD'],
- infos: ['TBD'],
- // for each key if import was a success,
- // and if it was an update of preexisting key
+ infos: ['result'],
+ type: [],
+ data: [],
+ params: []
}
},
- */
- /**
- deletekey: {
+ delete: {
pinentry: true,
- required: {
- 'fingerprint': {
+ required:{
+ 'key': {
+ allowed: ['string']
+ }
+ },
+ optional: {
+ 'protocol': {
allowed: ['string'],
- // array_allowed: TBD Allow several Keys to be deleted at once?
+ allowed_data: ['cms', 'openpgp']
},
- optional: {
- 'TBD' //Flag to delete secret Key ?
- }
+ // 'secret': { not yet implemented
+ // allowed: ['boolean']
+ // }
+
+ },
answer: {
- type ['TBD'],
- infos: ['']
- // TBD (optional) Some kind of 'ok' if delete was successful.
+ data: [],
+ params:['success'],
+ infos: []
}
- }
- */
-
+ },
/**
*TBD get armored secret different treatment from keyinfo!
* TBD key modification?
- * encryptsign: TBD
+
*/
version: {