summaryrefslogtreecommitdiff
path: root/lang/js/jsdoc_index.md
blob: b7371ad5ccc208f8c19a163960f8eea7684e6acc (plain)
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
Using gpgme.js
---------------
At first, make sure that the environment you want to use gpgme.js in has access
and permissions for nativeMessaging, and gpgme-json installed. For details,
see the README.

The library itself is started via the {@link init} method. This will test the
nativeMessaging connection, and then resolve into an Object offering
the top level API:

* [encrypt]{@link GpgME#encrypt}
* [decrypt]{@link GpgME#decrypt}
* [sign]{@link GpgME#sign}
* [verify]{@link GpgME#verify}
* [Keyring]{@link GPGME_Keyring}

```
gpgmejs.init()
    .then(function(GPGME) {
        // using GPGME
    }, function(error){
        // error handling;
    })
```

All methods that require communication with nativeMessaging are asynchronous,
using Promises. Rejections will be instances of {@link GPGME_Error}.

An exaeption are Keys, which can be initialized in a 'sync' mode, allowing them
to be cached and used synchronously until manually refreshed.

Keyring and Keys
----------------
The gnupg keys can be accessed via the [Keyring]{@link GPGME_Keyring}.

The Keyring offers the methods for accessing information on all Keys known to
gnupg.

**Due to security constraints, the javascript-binding currently only offers
limited support for secret-Key interaction.**

The existance of secret Keys is not secret, and those secret Keys can be used
for signing, but Operations that may expose, modify or delete secret Keys are
not supported.

* [getKeysArmored]{@link GPGME_Keyring#getKeysArmored}
* [getKeys]{@link GPGME_Keyring#getKeys}
* [getDefaultKey]{@link GPGME_Keyring#getDefaultKey}
* [generateKey]{@link GPGME_Keyring#generateKey}
* [deleteKey]{@link GPGME_Keyring#deleteKey}