|
Packit Service |
30b792 |
Using gpgme.js
|
|
Packit Service |
30b792 |
---------------
|
|
Packit Service |
30b792 |
At first, make sure that the environment you want to use gpgme.js in has access
|
|
Packit Service |
30b792 |
and permissions for nativeMessaging, and gpgme-json installed. For details,
|
|
Packit Service |
30b792 |
see the README.
|
|
Packit Service |
30b792 |
|
|
Packit Service |
30b792 |
The library itself is started via the {@link init} method. This will test the
|
|
Packit Service |
30b792 |
nativeMessaging connection, and then resolve into an Object offering
|
|
Packit Service |
30b792 |
the top level API:
|
|
Packit Service |
30b792 |
|
|
Packit Service |
30b792 |
* [encrypt]{@link GpgME#encrypt}
|
|
Packit Service |
30b792 |
* [decrypt]{@link GpgME#decrypt}
|
|
Packit Service |
30b792 |
* [sign]{@link GpgME#sign}
|
|
Packit Service |
30b792 |
* [verify]{@link GpgME#verify}
|
|
Packit Service |
30b792 |
* [Keyring]{@link GPGME_Keyring}
|
|
Packit Service |
30b792 |
|
|
Packit Service |
30b792 |
```
|
|
Packit Service |
30b792 |
gpgmejs.init()
|
|
Packit Service |
30b792 |
.then(function(GPGME) {
|
|
Packit Service |
30b792 |
// using GPGME
|
|
Packit Service |
30b792 |
}, function(error){
|
|
Packit Service |
30b792 |
// error handling;
|
|
Packit Service |
30b792 |
})
|
|
Packit Service |
30b792 |
```
|
|
Packit Service |
30b792 |
|
|
Packit Service |
30b792 |
All methods that require communication with nativeMessaging are asynchronous,
|
|
Packit Service |
30b792 |
using Promises. Rejections will be instances of {@link GPGME_Error}.
|
|
Packit Service |
30b792 |
|
|
Packit Service |
30b792 |
An exaeption are Keys, which can be initialized in a 'sync' mode, allowing them
|
|
Packit Service |
30b792 |
to be cached and used synchronously until manually refreshed.
|
|
Packit Service |
30b792 |
|
|
Packit Service |
30b792 |
Keyring and Keys
|
|
Packit Service |
30b792 |
----------------
|
|
Packit Service |
30b792 |
The gnupg keys can be accessed via the [Keyring]{@link GPGME_Keyring}.
|
|
Packit Service |
30b792 |
|
|
Packit Service |
30b792 |
The Keyring offers the methods for accessing information on all Keys known to
|
|
Packit Service |
30b792 |
gnupg.
|
|
Packit Service |
30b792 |
|
|
Packit Service |
30b792 |
**Due to security constraints, the javascript-binding currently only offers
|
|
Packit Service |
30b792 |
limited support for secret-Key interaction.**
|
|
Packit Service |
30b792 |
|
|
Packit Service |
30b792 |
The existence of secret Keys is not secret, and those secret Keys can be used
|
|
Packit Service |
30b792 |
for signing, but Operations that may expose, modify or delete secret Keys are
|
|
Packit Service |
30b792 |
not supported.
|
|
Packit Service |
30b792 |
|
|
Packit Service |
30b792 |
* [getKeysArmored]{@link GPGME_Keyring#getKeysArmored}
|
|
Packit Service |
30b792 |
* [getKeys]{@link GPGME_Keyring#getKeys}
|
|
Packit Service |
30b792 |
* [getDefaultKey]{@link GPGME_Keyring#getDefaultKey}
|
|
Packit Service |
30b792 |
* [generateKey]{@link GPGME_Keyring#generateKey}
|
|
Packit Service |
30b792 |
* [deleteKey]{@link GPGME_Keyring#deleteKey}
|