diff options
author | Maximilian Krambach <[email protected]> | 2018-08-20 15:46:29 +0000 |
---|---|---|
committer | Maximilian Krambach <[email protected]> | 2018-08-20 15:46:29 +0000 |
commit | 91c2362550f787cc28d764c0e571e911c740f74f (patch) | |
tree | 68f0d937295c47db47f986716966761f7bcbebbb /lang/js | |
parent | js: add and apply eslint rules (diff) | |
download | gpgme-91c2362550f787cc28d764c0e571e911c740f74f.tar.gz gpgme-91c2362550f787cc28d764c0e571e911c740f74f.zip |
js: set expiry date on generateKey
--
* on the javascript side a Date is expected, gpggme-json expects
seconds from 'now'
Diffstat (limited to 'lang/js')
-rw-r--r-- | lang/js/src/Keyring.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lang/js/src/Keyring.js b/lang/js/src/Keyring.js index 90d267db..7d9b370a 100644 --- a/lang/js/src/Keyring.js +++ b/lang/js/src/Keyring.js @@ -388,8 +388,9 @@ export class GPGME_Keyring { msg.setParameter('userid', userId); msg.setParameter('algo', algo ); if (expires){ + const now = new Date(); msg.setParameter('expires', - Math.floor(expires.valueOf()/1000)); + Math.floor((expires - now) /1000)); } else { msg.setParameter('expires', 0); } |