最近才意识到“chmod”接受“777”以外的一些参数,我试图将签名文件发送到自动电子邮件处理程序。我认为在两端使用 gpg 会很容易,但我不知道将公钥放在接收器上的哪里。
签约方对其搜寻策略及自我描述如下:
gpg -v --debug-all --list-keys
gpg: NOTE: no default option file `/home/marchywka/.gnupg/gpg.conf'
gpg: using PGP trust model
gpg: DBG: fd_cache_open (/home/marchywka/.gnupg/pubring.gpg) not cached
gpg: DBG: iobuf-1.0: open `/home/marchywka/.gnupg/pubring.gpg' fd=4
gpg: DBG: iobuf-1.0: underflow: req=8192
gpg: DBG: iobuf-1.0: underflow: got=1219 rc=0
gpg: DBG: parse_packet(iob=1): type=6 length=269 (search.../../g10/keyring.c.996)
gpg: DBG: mpi_alloc(2048)
gpg: DBG: mpi_alloc_limb_space(2048)
gpg: DBG: mpi_alloc(64)
gpg: DBG: mpi_alloc_limb_space(64)
gpg: DBG: free_packet() type=6
gpg: DBG: mpi_free
gpg: DBG: dummy m_size called
gpg: DBG: mpi_free_limb_space of size 0
gpg: DBG: mpi_free
gpg: DBG: dummy m_size called
gpg: DBG: mpi_free_limb_space of size 0
gpg: DBG: fd_cache_open (/home/marchywka/.gnupg/pubring.gpg) not cached
gpg: DBG: iobuf-2.0: open `/home/marchywka/.gnupg/pubring.gpg' fd=5
gpg: DBG: iobuf-2.0: underflow: req=8192
gpg: DBG: iobuf-2.0: underflow: got=1219 rc=0
gpg: DBG: parse_packet(iob=2): type=6 length=269 (parse.../../g10/keyring.c.390)
gpg: DBG: mpi_alloc(2048)
gpg: DBG: mpi_alloc_limb_space(2048)
gpg: DBG: mpi_alloc(64)
gpg: DBG: mpi_alloc_limb_space(64)
gpg: DBG: parse_packet(iob=2): type=13 length=60 (parse.../../g10/keyring.c.390)
gpg: DBG: parse_packet(iob=2): type=2 length=312 (parse.../../g10/keyring.c.390)
gpg: DBG: mpi_alloc(2048)
gpg: DBG: mpi_alloc_limb_space(2048)
gpg: DBG: parse_packet(iob=2): type=12 length=2 (parse.../../g10/keyring.c.390)
gpg: DBG: free_packet() type=12
gpg: DBG: parse_packet(iob=2): type=14 length=269 (parse.../../g10/keyring.c.390)
gpg: DBG: mpi_alloc(2048)
gpg: DBG: mpi_alloc_limb_space(2048)
gpg: DBG: mpi_alloc(64)
gpg: DBG: mpi_alloc_limb_space(64)
gpg: DBG: parse_packet(iob=2): type=2 length=287 (parse.../../g10/keyring.c.390)
gpg: DBG: mpi_alloc(2048)
gpg: DBG: mpi_alloc_limb_space(2048)
gpg: DBG: parse_packet(iob=2): type=12 length=2 (parse.../../g10/keyring.c.390)
gpg: DBG: free_packet() type=12
gpg: DBG: iobuf-2.0: underflow: req=8192
gpg: DBG: iobuf-2.0: underflow: got=0 rc=-1
gpg: DBG: /home/marchywka/.gnupg/pubring.gpg: close fd 5
gpg: DBG: fd_cache_close (/home/marchywka/.gnupg/pubring.gpg) new slot created
gpg: DBG: iobuf-2.0: underflow: eof
gpg: DBG: iobuf-2.0: close `?'
/home/marchywka/.gnupg/pubring.gpg
----------------------------------
pub 2048R/4E2CF875 2020-05-09
uid Mike Marchywka (for remote commands) <[email protected]>
sub 2048R/E650EBC0 2020-05-09
gpg: DBG: free_packet() type=6
gpg: DBG: mpi_free
gpg: DBG: dummy m_size called
gpg: DBG: mpi_free_limb_space of size 0
gpg: DBG: mpi_free
gpg: DBG: dummy m_size called
gpg: DBG: mpi_free_limb_space of size 0
gpg: DBG: free_packet() type=13
gpg: DBG: free_packet() type=2
gpg: DBG: mpi_free
gpg: DBG: dummy m_size called
gpg: DBG: mpi_free_limb_space of size 0
gpg: DBG: free_packet() type=14
gpg: DBG: mpi_free
gpg: DBG: dummy m_size called
gpg: DBG: mpi_free_limb_space of size 0
gpg: DBG: mpi_free
gpg: DBG: dummy m_size called
gpg: DBG: mpi_free_limb_space of size 0
gpg: DBG: free_packet() type=2
gpg: DBG: mpi_free
gpg: DBG: dummy m_size called
gpg: DBG: mpi_free_limb_space of size 0
gpg: DBG: parse_packet(iob=1): type=14 length=269 (search.../../g10/keyring.c.996)
gpg: DBG: mpi_alloc(2048)
gpg: DBG: mpi_alloc_limb_space(2048)
gpg: DBG: mpi_alloc(64)
gpg: DBG: mpi_alloc_limb_space(64)
gpg: DBG: free_packet() type=14
gpg: DBG: mpi_free
gpg: DBG: dummy m_size called
gpg: DBG: mpi_free_limb_space of size 0
gpg: DBG: mpi_free
gpg: DBG: dummy m_size called
gpg: DBG: mpi_free_limb_space of size 0
gpg: DBG: iobuf-1.0: underflow: req=8192
gpg: DBG: iobuf-1.0: underflow: got=0 rc=-1
gpg: DBG: /home/marchywka/.gnupg/pubring.gpg: close fd 4
gpg: DBG: fd_cache_close (/home/marchywka/.gnupg/pubring.gpg) new slot created
gpg: DBG: iobuf-1.0: underflow: eof
gpg: DBG: iobuf-1.0: close `?'
random usage: poolsize=600 mixed=0 polls=0/3 added=15/528
outmix=0 getlvl1=0/0 getlvl2=0/0
secmem usage: 1408/1408 bytes in 2/2 blocks of pool 1408/65536
marchywka@happy:/home/documents/cpp/proj/mikemail$ gpg --version
gpg (GnuPG) 1.4.20
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Home: ~/.gnupg
Supported algorithms:
Pubkey: RSA, RSA-E, RSA-S, ELG-E, DSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: MD5, SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2
解码端甚至不会在 ~/.gnupg 中查找任何内容,
gpg -v --debug-level guru --list-keys
gpg: enabled debug flags: packet mpi crypto filter iobuf memory cache memstat trust hashing ipc clock lookup extprog
gpg: DBG: [not enabled in the source] start
gpg: using pgp trust model
gpg: DBG: [not enabled in the source] keydb_new
gpg: DBG: [not enabled in the source] keydb_search_reset
gpg: DBG: keydb_search: reset (hd=0x000056214bbd5e70)
gpg: DBG: [not enabled in the source] keydb_search enter
gpg: DBG: keydb_search: 1 search descriptions:
gpg: DBG: keydb_search 0: FIRST
gpg: DBG: keydb_search: searching keybox (resource 0 of 1)
gpg: DBG: keydb_search: searched keybox (resource 0 of 1) => EOF
gpg: DBG: [not enabled in the source] keydb_search leave (not found)
gpg: DBG: [not enabled in the source] stop
gpg: keydb: handles=1 locks=0 parse=0 get=0
gpg: build=0 update=0 insert=0 delete=0
gpg: reset=1 found=0 not=1 cache=0 not=0
gpg: kid_not_found_cache: count=0 peak=0 flushes=0
gpg: sig_cache: total=0 cached=0 good=0 bad=0
gpg: random usage: poolsize=600 mixed=0 polls=0/0 added=0/0
outmix=0 getlvl1=0/0 getlvl2=0/0
gpg: rndjent stat: collector=0x0000000000000000 calls=0 bytes=0
gpg: secmem usage: 0/65536 bytes in 0 blocks
mike@mike-Latitude-E6510:~/junk/uz$ gpg --version
gpg (GnuPG) 2.2.19
libgcrypt 1.8.5
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Home: /home/mike/.gnupg
Supported algorithms:
Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2
mike@mike-Latitude-E6510:~/junk/uz$
ls -al ~/.gnupg
total 24
drwx------ 3 mike mike 4096 Dec 13 05:53 .
drwxr-xr-x 26 mike mike 4096 Dec 13 05:53 ..
drwx------ 2 mike mike 4096 Jun 23 20:06 private-keys-v1.d
-rw------- 1 mike mike 1219 Dec 13 05:44 pubring.gpg
-rw------- 1 mike mike 32 Dec 13 05:07 pubring.kbx
-rw------- 1 mike mike 1200 Dec 13 05:06 trustdb.gpg
接收者应该在哪里找到公钥信息?谢谢。
答案1
这不是一个完全有用的答案,但如果您只想验证签名并复制公钥,它确实可以解决问题。
GNU 隐私手册程序运行良好,
复制这个的输出,
$ gpg --armor --export
然后从保存上述输出的文件中导入它,
$gpg --import keyfile
尽管它没有描述搜索策略,但它可能会解决那些在网络上搜索的人的问题。