singpolyma / openpgp-php

OpenPGP.php is a pure-PHP implementation of the OpenPGP Message Format (RFC 4880).
http://singpolyma.github.io/openpgp-php/
The Unlicense
179 stars 69 forks source link

Expiration check on PGP key #95

Closed OxMarco closed 3 years ago

OxMarco commented 4 years ago

I noticed when parsing a PGP key there is a property named _v3_days_ofvalidity, how can it be used to determine the key validity and is it compatible with most generation algorithms?

singpolyma commented 3 years ago

v3_days_of_validity is only for v3 keys, of which there are very few in the wild. In general what you will actually want is to look for a OpenPGP_SignaturePacket_KeyExpirationTimePacket inside a self-signature on the key.