如何使用asc签名文件验证文件?


15

例如,该项目提供了一个*.asc带有PGP签名的文件来验证下载的内容(与校验和相对,您可以看到空白列):https : //ossec.github.io/downloads.html

我将如何使用该文件?我尝试了gpg --verify其他变体,但它似乎与文件名匹配,但是下载的文件名并不完全相同...不确定应如何工作。

Answers:


16
  • 下载密钥文件:
wget https://ossec.github.io/files/OSSEC-ARCHIVE-KEY.asc
  • 检查密钥文件,以确认它具有EE1B0E6B2D8387B7其密钥ID。
gpg --keyid-format long --list-options show-keyring OSSEC-ARCHIVE-KEY.asc
  • 如果正确,则导入密钥:
gpg --import OSSEC-ARCHIVE-KEY.asc
  • 下载软件包
wget https://github.com/ossec/ossec-hids/archive/2.9.3.tar.gz
  • 下载签名文件
https://github.com/ossec/ossec-hids/releases/download/2.9.3/ossec-hids-2.9.3.tar.gz.asc
  • 验证一下
gpg --verify ossec-hids-2.9.3.tar.gz.asc 2.9.3.tar.gz

输出量

gpg: Signature made Sat Dec 23 16:13:01 2017 UTC
gpg:                using RSA key EE1B0E6B2D8387B7
gpg: Good signature from "Scott R. Shinn <scott@atomicorp.com>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: B50F B194 7A0A E311 45D0  5FAD EE1B 0E6B 2D83 87B7

1
--verify选项似乎需要签名文件
niahoo

我得到gpg: WARNING: "--show-keyring" is a deprecated option gpg: please use "--list-options show-keyring" instead
达恩·达斯卡莱斯卡
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.