From 91c2362550f787cc28d764c0e571e911c740f74f Mon Sep 17 00:00:00 2001 From: Maximilian Krambach Date: Mon, 20 Aug 2018 17:46:29 +0200 Subject: [PATCH] js: set expiry date on generateKey -- * on the javascript side a Date is expected, gpggme-json expects seconds from 'now' --- lang/js/src/Keyring.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); }