GPG - Generate Keypairs
1. generate a gpg key
gpg --gen-key
gpg (GnuPG) 2.2.27; Copyright (C) 2021 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.Note: Use "gpg --full-generate-key" for a full featured key generation dialog.
GnuPG needs to construct a user ID to identify your key.
2. Enter a real name
Real name: Richard Yim
3. Enter a email
Email address: RichardYim@ami.com
4. Confirm information
You selected this USER-ID:
"Richard Yim <RichardYim@ami.com>"
Change (N)ame, (E)mail, or (O)kay/(Q)uit?
5. Enter the passphrase (make sure remembered)
passphrase is better with digit(s) or special-character(s)
┌──────────────────────────────────────────────────────┐
│ Please enter the passphrase to │
│ protect your new key │
│ │
│ Passphrase: ________________________________________ │
│ │
│ <OK> <Cancel> │
└──────────────────────────────────────────────────────┘
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
...
gpg: /home/jun/.gnupg/trustdb.gpg: trustdb created
...
public and secret key created and signed.pub rsa3072 2023-07-22 [SC] [expires: 2025-07-21]
(...pub key id here...)
uid Richard Yim richardyim@ami.com
sub rsa3072 2023-07-22 [E] [expires: 2025-07-21]
- id of key:
pub
- expires date of key:
sub
... [expires: 2025-07-21]
Modify expires date
1. Edit with public key ID
gpg --edit-key <id of pub key>
2. Insert expires in STDIN
gpg> expires
3. Select expires date
Changing expiration time for the primary key.
Please specify how long the key should be valid.
0 = key does not expire
= key expires in n days
w = key expires in n weeks
m = key expires in n months
y = key expires in n years
Key is valid for? (0)