OpenPGP:为什么要生成密钥名称和电子邮件是强制性的?

发布于 2025-02-08 19:15:17 字数 656 浏览 2 评论 0原文

on openpgp.js name电子邮件属性是必须的:

await generateKey({ curve: 'brainpoolP512r1',  userIDs: [{ name: 'Test', email: '[email protected]' }] });

在一个项目中,我想将OpenPGP用于不同的情况,在其他情况下,没有name电子邮件,每对密钥都将链接到数据库中的内部id

在这个项目中,我只需要加密并签署消息。

我的问题是:OpenPGP是否最适合仅使用任何用户信息签署和加密消息?

On Openpgp.js, in order to generate the encryption keys, the name and the email properties are mandatory:

await generateKey({ curve: 'brainpoolP512r1',  userIDs: [{ name: 'Test', email: '[email protected]' }] });

In a project I'd like to use OpenPGP for a different scenario where there will be no name or email, each pair of keys would be linked to an internal id in the database.

In this project I just need to encrypt and sign messages.

My question is: Is OpenPGP best suited for just signing and encrypting messages with out any user information?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

伊面 2025-02-15 19:15:17

名称和电子邮件包含“用户ID”,这是OpenPGP Spec(RFC 4880)中的一流概念。至少在某些情况下,它们是强制性的(例如“ 11.1。可转让的公共钥匙”)。毫不奇怪的是,实施坚持填写此信息。 GNUPG坚持使用“有效”电子邮件地址afair,尽管我曾经看过没有列出电子邮件地址的密钥。

如果您只想使用一些加密键,并且您确定用户ID对您来说并不重要,只需在其中进行硬码。

OpenPGP主要是为了在人们之间进行更私人和值得信赖的人之间的远程通信开发。但这只是一种工具,了解它可能会发现新颖的有益用例。例如,很多人使用它加密备份。您可能会发现它仅适用于您的情况,或者没有意义。

The name and email comprise "User ID", which is a first-class concept in OpenPGP spec (RFC 4880). At least in some contexts they are mandatory (e.g. "11.1. Transferable Public Keys"). No surprise implementations insist on filling this info. GnuPG insists on "valid" email address AFAIR, although I once have seen a key without email address listed.

If you want just some crypto keys and you're sure that User ID doesn't matter to you, just hardcode something in there.

OpenPGP was developed primarily for making remote communications between people more private and trustworthy. But it's just a tool, having understanding of it you may find novel beneficial use cases. For example, a lot of people encrypt their backups with it. You may find it just works for your case, or that it doesn't make sense.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文