Skip to content

jasonaowen/gpg-expiration

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

gpg-expiration

Check if a GPG key will expire soon.

Usage

gpg-expiration needs a key ID, or other uniquely identifying search term; gpg --list-keys SEARCH_TERM should return exactly one key.

gpg-expiration also takes an interval, specified in days. If the key (or any of its subkeys) expires within that interval, it will print the primary UID and the expiration date(s), then exit with a return code of 1. If not, it will silently exit with a return code of 0.

$ ./gpg-expiration.py --days 30 2B38BD955557647E7C26B53C19E27469767CFC68

Add it as a cron job:

$ crontab -e
# m  h dom mon dow command
  0 12  *   *  Mon ~/dev/gpg-expiration/gpg-expiration.py --days 30 2B38BD955557647E7C26B53C19E27469767CFC68

Dependencies

gpg-expiration depends on the official GPGME Python bindings.

The Python bindings are available in the Debian package python3-gpg:

$ sudo apt install python3-gpg

Releases

No releases published

Packages

No packages published

Languages