js: set expiry date on generateKey

--

* on the javascript side a Date is expected, gpggme-json expects
  seconds from 'now'
This commit is contained in:
Maximilian Krambach 2018-08-20 17:46:29 +02:00
parent dd32daad0b
commit 91c2362550

View File

@ -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);
}