mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
edit-key is now complete
This commit is contained in:
parent
1a80de41a5
commit
5ae562b41d
48 changed files with 2044 additions and 984 deletions
31
g10/keyid.c
31
g10/keyid.c
|
@ -296,6 +296,37 @@ datestr_from_sig( PKT_signature *sig )
|
|||
}
|
||||
|
||||
|
||||
const char *
|
||||
expirestr_from_pk( PKT_public_key *pk )
|
||||
{
|
||||
static char buffer[11+5];
|
||||
struct tm *tp;
|
||||
time_t atime;
|
||||
|
||||
if( !pk->valid_days )
|
||||
return "never ";
|
||||
atime = add_days_to_timestamp( pk->timestamp, pk->valid_days );
|
||||
tp = gmtime( &atime );
|
||||
sprintf(buffer,"%04d-%02d-%02d", 1900+tp->tm_year, tp->tm_mon+1, tp->tm_mday );
|
||||
return buffer;
|
||||
}
|
||||
|
||||
const char *
|
||||
expirestr_from_sk( PKT_secret_key *sk )
|
||||
{
|
||||
static char buffer[11+5];
|
||||
struct tm *tp;
|
||||
time_t atime;
|
||||
|
||||
if( !sk->valid_days )
|
||||
return "never ";
|
||||
atime = add_days_to_timestamp( sk->timestamp, sk->valid_days );
|
||||
tp = gmtime( &atime );
|
||||
sprintf(buffer,"%04d-%02d-%02d", 1900+tp->tm_year, tp->tm_mon+1, tp->tm_mday );
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
||||
/**************** .
|
||||
* Return a byte array with the fingerprint for the given PK/SK
|
||||
* The length of the array is returned in ret_len. Caller must free
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue