.gpg、.sig. 和 .asc 之间有什么有意义的区别?

What are the meaningful differences between .gpg, .sig., & .asc?

我知道 .asc 签名输出为文本文件,而 .sig.gpg 是二进制文件。

除此之外:

  1. .sig.gpg 是同一个文件但扩展名不同吗?如果不是,为什么要用一个而不是另一个?
  2. 文本文件和二进制文件,相对优势是什么?安全、效率、兼容性等

Are .sig and .gpg the same file with different extensions?

不,它们是 GnuPG 上下文中的不同文件。

  • .gpg - GNU Privacy Guard public 密钥环文件,二进制格式。请参阅 4.2 Configuration files
  • 中的示例
  • .sig - GPG 签名文档文件,二进制格式。
  • .asc - 带或不带包装文档的 ASCII 装甲签名,纯文本格式。通常用于clearsigned documents. Usually it's attached unmodified original doc and its signature. In the usage of detached signatures, you can generate signature only without original doc via --detach-sig.

If not, why use one over the other?

好问题!由于 OpenPGP 是一个开放标准 (RFC 4880),其 section 6 提供了详细的解释,我只引用关键部分:

In principle, any printable encoding scheme that met the requirements of the unsafe channel would suffice, since it would not change the underlying binary bit streams of the native OpenPGP data structures. The OpenPGP standard specifies one such printable encoding scheme to ensure interoperability.

我将使用此 answer 作为二进制与 ASCII 格式的优缺点的回复。