Openpgpjs: How do we set 'expiration time', when we create new key with OpenPGP?

Created on 11 Jan 2017  路  4Comments  路  Source: openpgpjs/openpgpjs

In OpenPGP.js we have a function Key.prototype.getExpirationTime, wich "returns the expiration time of the primary key or null if key does not expire":
https://github.com/openpgpjs/openpgpjs/blob/master/src/key.js#L472

But, how do we set this expiration time, when we create new key?
I do not see in this function https://github.com/openpgpjs/openpgpjs/blob/master/src/key.js#L938 or in documentation for it https://openpgpjs.org/openpgpjs/doc/module-key.html parameters for 'expiration time'

Feature

Most helpful comment

Yes, I just checked as well and there doesn't seem to be a way to do it. It's should be fairly trivial to do. I'll mark this as a feature request and try to find some time to do it. If you'd like to submit a PR for it with tests that would be great too.

All 4 comments

Yes, I just checked as well and there doesn't seem to be a way to do it. It's should be fairly trivial to do. I'll mark this as a feature request and try to find some time to do it. If you'd like to submit a PR for it with tests that would be great too.

Here is a PR that implements this feature for OpenPGP.js v1.x: https://github.com/openpgpjs/openpgpjs/pull/458
Could be the basis to implement it for OpenPGP.js v2.

Just made a pull request based on #458 in pull #514.

Merged

Was this page helpful?
0 / 5 - 0 ratings