[英]How would you reconstruct a public key from the key s-expression and creation timestamp?
I'm specifically asking in relation to this answer where a user is trying to recreate the public key solely from the information in an openPGP Smartcard (due to losing the public key):关于这个答案,我特别询问用户试图仅从 openPGP 智能卡中的信息重新创建公钥(由于丢失公钥):
https://stackoverflow.com/a/69903994/17503333 https://stackoverflow.com/a/69903994/17503333
The answer states that you should be able to reconstruct the public key from the information retrieved from the gpg-connect-agent through gpg and libcrypt itself, but does not specify how :答案表明您应该能够通过 gpg 和 libcrypt 本身从 gpg-connect-agent 检索到的信息重建公钥,但没有指定如何:
Take the creation time from the KEY-TIME lines.
从 KEY-TIME 行中获取创建时间。 I used /decode and /hex above only for readability.
我使用上面的 /decode 和 /hex 只是为了便于阅读。 You should use
你应该使用
> /datafile out > scd readkey OPENPGP.1 OK > /bye
instead which writes the s-expression with the public key to the file out.
而是将带有公钥的 s 表达式写入文件。 The Libgcrypt functions take those s-expressions as arguments.
Libgcrypt 函数将这些 s 表达式作为 arguments。 Now you need to feed it to gpg to create the public key part and the self-signatures.
现在您需要将其提供给 gpg 以创建公钥部分和自签名。
Is there any way to do this?有没有办法做到这一点? There isn't any specific instructions online that specify what tools/functions within librypt and gpg to use to recreate the public key.
在线没有任何具体说明指定 librypt 和 gpg 中用于重新创建公钥的工具/功能。
This may be done as following (assumming all required data is returned by the readkey):这可以按如下方式完成(假设所有需要的数据都由 readkey 返回):
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.