aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaximilian Krambach <[email protected]>2018-08-20 15:46:29 +0000
committerMaximilian Krambach <[email protected]>2018-08-20 15:46:29 +0000
commit91c2362550f787cc28d764c0e571e911c740f74f (patch)
tree68f0d937295c47db47f986716966761f7bcbebbb
parentjs: add and apply eslint rules (diff)
downloadgpgme-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'
-rw-r--r--lang/js/src/Keyring.js3
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);
}