gpgkey

gpgkey

GPG 키 생성하기

gpg --full-gen-key

또는

$ gpg --default-new-key-algo rsa4096 --gen-key
gpg (GnuPG) 2.3.3; 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.
 
Real name: navix
Email address: foo@navix.navercorp.com
You selected this USER-ID:
    "navix <foo@navix.navercorp.com>"
 
Change (N)ame, (E)mail, or (O)kay/(Q)uit? o
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
generator a better chance to gain enough entropy.
gpg: agent_genkey failed: No pinentry
Key generation failed: No pinentry
$  gpg --full-gen-key
gpg (GnuPG) 2.3.3; 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.
 
Please select what kind of key you want:
   (1) RSA and RSA (default)
   (2) DSA and Elgamal
   (3) DSA (sign only)
   (4) RSA (sign only)
  (14) Existing key from card
Your selection? 1
RSA keys may be between 1024 and 4096 bits long.
What keysize do you want? (3072) 4096
Requested keysize is 4096 bits
Please specify how long the key should be valid.
         0 = key does not expire
      <n>  = key expires in n days
      <n>w = key expires in n weeks
      <n>m = key expires in n months
      <n>y = key expires in n years
Key is valid for? (0) 5y
Key expires at Mon 06 Aug 2029 02:49:22 PM KST
Is this correct? (y/N) y
 
GnuPG needs to construct a user ID to identify your key.
 
Real name: navix
Email address: foo@navix.navercorp.com
Comment: Packman
You selected this USER-ID:
    "navix (Packman) <foo@navix.navercorp.com>"
 
Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o
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
generator a better chance to gain enough entropy.
gpg: agent_genkey failed: No pinentry
Key generation failed: No pinentry

키리스트 확인하기

[foo@lion ~]$ gpg --list-keys
/foo/.gnupg/pubring.kbx
------------------------
pub   rsa2048 2023-06-13 [SC] [expires: 2033-06-10]
      71F2050CD6EA46B5D9B362D4DFD13C25FEE808BB
uid           [ unknown] Linux Engineering (GPG key for NAVIX) <foo@navercorp.com>
sub   rsa2048 2023-06-13 [E] [expires: 2033-06-10]

키 보내기

gpg --send-keys 키_아이디

키 받아오기

gpg --recv-keys 키_아이디