HOW TO: Update an expiration date for a key - PGP Command Line


Article ID: 180179


Updated On:


PGP Command Line




This article describes how to update the expiration date of a key with PGP Command Line.

The expiration date of your key can be updated if the key has a specified expiration date. You can update the expiration date, the number of days, or remove the expiration date for your PGP key. When specifying the date for the key to expire, the date format is yyyy-mm-dd.



  • <user> is the user ID, portion of the user ID, or the key ID of the key whose expiration date is being removed.
  • <pass> is the passphrase of the key.

Use the following commands to update the expiration date of your PGP key.

Set the expiration date

pgp --set-expiration-date --expiration-date <user> --passphrase <pass>

Example: pgp --set-expiration-date --expiration-date 2020-01-01 "Test User " --passphrase password

Set the number of days to expiration

pgp --expiration-days <user> --passphrase <pass>

Example: pgp --set-expiration-days 365 "Test User" --passphrase password


Note: You cannot use --expiration-date and --expiration-days in one operation.

Remove the expiration date from the key

  pgp --remove-expiration-date <user> --passphrase <pass>

Example: pgp --remove-expiration-date "Test User" --passphrase password

After updating the expiration date for your key, you can confirm the update by listing the details of your key using the following command.

pgp --list-key-details