gpt4 book ai didi

python - OpenPGP/X.509 桥 : how to verify public key?

转载 作者:太空宇宙 更新时间:2023-11-03 11:53:31 25 4
gpt4 key购买 nike

我想使用 OpenPGP authentication over TLS ,但由于缺乏实现,我不得不使用临时解决方案:OpenPGP/X.509 桥接证书。

该方法与 Foaf 中使用的方法非常相似:
https://svn.java.net/svn/sommer~svn/trunk/misc/FoafServer/pgpx509/src/net/java/dev/sommer/foafserver/utils/PgpX509Bridge.java

Basically, you create a certificate request starting from a converted PGP private key, including your converted PGP public key into the certificate request. Then you sign the request with your converted PGP private key.

我使用“converted”这个词是因为 OpenPGP 和 OpenSSL key 格式不兼容:我必须从 OpenPGP key 中提取 key 参数并使用它们形成新的 X.509-兼容 (OpenSSL) key 。然而,它按预期工作。

结果是一个 X.509 证书,在 X.509 证书的公钥中使用 PGP 公钥参数,但没有用户 ID 和公钥签名,因此无法用于身份验证目的。

这里缺少的部分是服务器身份验证。服务器先前已经签署了用户的 PGP 公钥,但我如何通过 X.509 桥接证书进行验证?

即使我使用我的 PGP 用户 ID 作为我的 CN(通用名称),我如何证明它与原始 OpenPGP key 中使用的用户 ID 相同?
X.509 桥接证书上没有公钥签名,只有相同的 key 参数。我可以安全地检查那些吗?

虽然我必须在 Python 中执行此操作,但任何关于一般如何进行的建议都会非常有帮助。

最佳答案

我得到了关于加密的答案: https://crypto.stackexchange.com/a/11709/9284

If you can put the entire PGP certificate in a proprietary non-critical extension then you don't need to find the PGP certificate in a store. This solution depends on the condition that you are able to create your own OID and insert the PGP certificate in the extension. Furthermore, the server should accept such a certificate and contain methods of validating the PGP certificate as well.

The CA can accept or refuse requests containing a PGP certificate. It should at least check that the key in the PGP certificate matches the one in the signed request. One method of doing this is to validate that the modulus of the PGP and X5.09 public key match.

关于python - OpenPGP/X.509 桥 : how to verify public key?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19678786/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com