Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

218 lines
7.2KB

  1. root@209899561fe9:/home/trigen/projects/build-config/apt-publisher# gpg --full-generate-key
  2. gpg: WARNING: unsafe permissions on homedir '/root/.gnupg'
  3. gpg (GnuPG) 2.2.4; Copyright (C) 2017 Free Software Foundation, Inc.
  4. This is free software: you are free to change and redistribute it.
  5. There is NO WARRANTY, to the extent permitted by law.
  6. gpg: keybox '/root/.gnupg/pubring.kbx' created
  7. Please select what kind of key you want:
  8. (1) RSA and RSA (default)
  9. (2) DSA and Elgamal
  10. (3) DSA (sign only)
  11. (4) RSA (sign only)
  12. Your selection? 1
  13. RSA keys may be between 1024 and 4096 bits long.
  14. What keysize do you want? (3072) 4096
  15. Requested keysize is 4096 bits
  16. Please specify how long the key should be valid.
  17. 0 = key does not expire
  18. <n> = key expires in n days
  19. <n>w = key expires in n weeks
  20. <n>m = key expires in n months
  21. <n>y = key expires in n years
  22. Key is valid for? (0) 0
  23. Key does not expire at all
  24. Is this correct? (y/N) y
  25. GnuPG needs to construct a user ID to identify your key.
  26. Real name: Ray Burgemeestre
  27. Email address: ray@cppse.nl
  28. Comment:
  29. You selected this USER-ID:
  30. "Ray Burgemeestre <ray@cppse.nl>"
  31. Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O
  32. We need to generate a lot of random bytes. It is a good idea to perform
  33. some other action (type on the keyboard, move the mouse, utilize the
  34. disks) during the prime generation; this gives the random number
  35. generator a better chance to gain enough entropy.
  36. We need to generate a lot of random bytes. It is a good idea to perform
  37. some other action (type on the keyboard, move the mouse, utilize the
  38. disks) during the prime generation; this gives the random number
  39. generator a better chance to gain enough entropy.
  40. gpg: /root/.gnupg/trustdb.gpg: trustdb created
  41. gpg: key 234F14AB5CE16B7B marked as ultimately trusted
  42. gpg: directory '/root/.gnupg/openpgp-revocs.d' created
  43. gpg: revocation certificate stored as '/root/.gnupg/openpgp-revocs.d/D16D83CA3E4397DEB2462A3B234F14AB5CE16B7B.rev'
  44. public and secret key created and signed.
  45. pub rsa4096 2019-12-27 [SC]
  46. D16D83CA3E4397DEB2462A3B234F14AB5CE16B7B
  47. uid Ray Burgemeestre <ray@cppse.nl>
  48. sub rsa4096 2019-12-27 [E]
  49. root@209899561fe9:/home/trigen/projects/build-config/apt-publisher#
  50. ---
  51. had to invoke this to get the key ids again:
  52. --
  53. root@209899561fe9:/home/trigen/projects/build-config/apt-publisher# gpg --keyid-format SHORT -k
  54. gpg: WARNING: unsafe permissions on homedir '/root/.gnupg'
  55. /root/.gnupg/pubring.kbx
  56. ------------------------
  57. pub rsa4096/5CE16B7B 2019-12-27 [SC]
  58. D16D83CA3E4397DEB2462A3B234F14AB5CE16B7B
  59. uid [ultimate] Ray Burgemeestre <ray@cppse.nl>
  60. sub rsa4096/43C5B68C 2019-12-27 [E]
  61. --- mapping from blog post ---
  62. theirs 10E6133F is ours: 5CE16B7B
  63. theirs 7B34E07C is ours: 43C5B68C
  64. ---
  65. root@209899561fe9:/home/trigen/projects/build-config/apt-publisher# gpg --edit-key 5CE16B7B
  66. gpg: WARNING: unsafe permissions on homedir '/root/.gnupg'
  67. gpg (GnuPG) 2.2.4; Copyright (C) 2017 Free Software Foundation, Inc.
  68. This is free software: you are free to change and redistribute it.
  69. There is NO WARRANTY, to the extent permitted by law.
  70. Secret key is available.
  71. sec rsa4096/234F14AB5CE16B7B
  72. created: 2019-12-27 expires: never usage: SC
  73. trust: ultimate validity: ultimate
  74. ssb rsa4096/DD5B61D243C5B68C
  75. created: 2019-12-27 expires: never usage: E
  76. [ultimate] (1). Ray Burgemeestre <ray@cppse.nl>
  77. gpg> addkey
  78. Please select what kind of key you want:
  79. (3) DSA (sign only)
  80. (4) RSA (sign only)
  81. (5) Elgamal (encrypt only)
  82. (6) RSA (encrypt only)
  83. Your selection? 4
  84. RSA keys may be between 1024 and 4096 bits long.
  85. What keysize do you want? (3072) 4096
  86. Requested keysize is 4096 bits
  87. Please specify how long the key should be valid.
  88. 0 = key does not expire
  89. <n> = key expires in n days
  90. <n>w = key expires in n weeks
  91. <n>m = key expires in n months
  92. <n>y = key expires in n years
  93. Key is valid for? (0)
  94. Key does not expire at all
  95. Is this correct? (y/N) y
  96. Really create? (y/N) y
  97. We need to generate a lot of random bytes. It is a good idea to perform
  98. some other action (type on the keyboard, move the mouse, utilize the
  99. disks) during the prime generation; this gives the random number
  100. generator a better chance to gain enough entropy.
  101. sec rsa4096/234F14AB5CE16B7B
  102. created: 2019-12-27 expires: never usage: SC
  103. trust: ultimate validity: ultimate
  104. ssb rsa4096/DD5B61D243C5B68C
  105. created: 2019-12-27 expires: never usage: E
  106. ssb rsa4096/C91687F126512AB8
  107. created: 2019-12-27 expires: never usage: S
  108. [ultimate] (1). Ray Burgemeestre <ray@cppse.nl>
  109. gpg> save
  110. ---
  111. get ID again:
  112. root@209899561fe9:/home/trigen/projects/build-config/apt-publisher# gpg --keyid-format SHORT -k
  113. gpg: WARNING: unsafe permissions on homedir '/root/.gnupg'
  114. /root/.gnupg/pubring.kbx
  115. ------------------------
  116. pub rsa4096/5CE16B7B 2019-12-27 [SC]
  117. D16D83CA3E4397DEB2462A3B234F14AB5CE16B7B
  118. uid [ultimate] Ray Burgemeestre <ray@cppse.nl>
  119. sub rsa4096/43C5B68C 2019-12-27 [E]
  120. sub rsa4096/26512AB8 2019-12-27 [S]
  121. ---
  122. theirs 10E6133F is ours: 5CE16B7B
  123. theirs 7B34E07C is ours: 43C5B68C
  124. theirs A72DB3EF is ours: 26512AB8
  125. ---
  126. mkdir keys
  127. gpg --export-secret-key 5CE16B7B > keys/private.key
  128. gpg --export 5CE16B7B >> keys/private.key
  129. gpg --export 5CE16B7B > keys/public.key
  130. gpg --export-secret-subkeys 26512AB8 > keys/signing.key
  131. -- ignored: #back up the private.key file before running this# rm private.key
  132. # not ignored:
  133. gpg --delete-secret-key 5CE16B7B
  134. root@209899561fe9:/home/trigen/projects/build-config/apt-publisher# gpg --delete-secret-key 5CE16B7B
  135. gpg: WARNING: unsafe permissions on homedir '/root/.gnupg'
  136. gpg (GnuPG) 2.2.4; Copyright (C) 2017 Free Software Foundation, Inc.
  137. This is free software: you are free to change and redistribute it.
  138. There is NO WARRANTY, to the extent permitted by law.
  139. sec rsa4096/234F14AB5CE16B7B 2019-12-27 Ray Burgemeestre <ray@cppse.nl>
  140. Delete this key from the keyring? (y/N) y
  141. This is a secret key! - really delete? (y/N) y
  142. root@209899561fe9:/home/trigen/projects/build-config/apt-publisher# gpg --import keys/public.key keys/signing.key
  143. gpg: WARNING: unsafe permissions on homedir '/root/.gnupg'
  144. gpg: key 234F14AB5CE16B7B: "Ray Burgemeestre <ray@cppse.nl>" not changed
  145. gpg: key 234F14AB5CE16B7B: "Ray Burgemeestre <ray@cppse.nl>" not changed
  146. gpg: To migrate 'secring.gpg', with each smartcard, run: gpg --card-status
  147. gpg: key 234F14AB5CE16B7B: secret key imported
  148. gpg: Total number processed: 2
  149. gpg: unchanged: 2
  150. gpg: secret keys read: 1
  151. gpg: secret keys imported: 1
  152. root@209899561fe9:/home/trigen/projects/build-config/apt-publisher# gpg --keyid-format SHORT -k
  153. gpg: WARNING: unsafe permissions on homedir '/root/.gnupg'
  154. /root/.gnupg/pubring.kbx
  155. ------------------------
  156. pub rsa4096/5CE16B7B 2019-12-27 [SC]
  157. D16D83CA3E4397DEB2462A3B234F14AB5CE16B7B
  158. uid [ultimate] Ray Burgemeestre <ray@cppse.nl>
  159. sub rsa4096/43C5B68C 2019-12-27 [E]
  160. sub rsa4096/26512AB8 2019-12-27 [S]
  161. # ignored: rm public.key signing.key
  162. gpg --keyserver keyserver.ubuntu.com --send-key 5CE16B7B
  163. # ok done :-)
  164. ---
  165. moment of truth:
  166. root@b1e2708c4531:/home/trigen/projects/build-config/apt-publisher# reprepro -b /repo includedeb bionic packages/*.deb
  167. Exporting indices...
  168. ; reprepro -b /repo list bionic