PGPPublicKey.getValidDays()

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

PGPPublicKey.getValidDays()

Chris Picton
I am trying to read the number of valid days for a public key created
with gpg, but the getValidDays() function returns only 0, not matter
which keyrings I pass to it.

It this a bug, or is my code wrong?  I have set the expire to 30 days
for my current keyring:

My code:
---------------
it = ring.getPublicKeys();
while (it.hasNext()) {
  PGPPublicKey k = (PGPPublicKey)it.next();
  log.info("Key: " + Long.toHexString(k.getKeyID()) + "|Expire Date: " +
k.getValidDays());
}
--------

Output:
-------
Key: 752ab2efceb47217|Expire Date: 0
Key: e2e6cc541fb920a9|Expire Date: 0
-------

My keyring: gpg --edit-key ceb47217
----------
Secret key is available.

pub  1024D/CEB47217  created: 2005-06-06 expires: 2005-07-06 trust: -/-
sub  2048g/1FB920A9  created: 2005-06-06 expires: 2005-07-06
(1). Chris - Tangent <[hidden email]>
-----------


Hope somebody can help
--
---------------------+----------------------------------------------------
        Chris Picton | PGP Key ID: 9D28A988 (wwwkeys.pgp.net)
 Solutions Developer | PGP Key Fingerprint:
     Tangent Systems | 2B46 29EA D530 79EC D9EA 3ED0 229D 6DD6 9D28 A988
        011 447 8096 | "Quid quid latine dictum sit, altum viditar"
[hidden email] | http://www.tangent.co.za/keys/chrisp.asc
---------------------+----------------------------------------------------

signature.asc (196 bytes) Download Attachment
Loading...