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):
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 :
Take the creation time from the KEY-TIME lines. I used /decode and /hex above only for readability. 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. The Libgcrypt functions take those s-expressions as arguments. Now you need to feed it to gpg to create the public key part and the self-signatures.
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.
This may be done as following (assumming all required data is returned by the readkey):
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.