Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I read signature from a packet::write_packet result? #256

Open
Jisu-Woniu opened this issue Nov 22, 2023 · 2 comments
Open

How can I read signature from a packet::write_packet result? #256

Jisu-Woniu opened this issue Nov 22, 2023 · 2 comments

Comments

@Jisu-Woniu
Copy link

I learned about generating a signature packet in the document, but I cannot get that packet back into a Signature type.

I tried to use Signature::from_slice(Version::New, &sig_data), but it failed with Pgp(ParsingError(MapOpt)).

@Jisu-Woniu
Copy link
Author

Jisu-Woniu commented Nov 22, 2023

@Jisu-Woniu
Copy link
Author

I managed to resolve it by using PacketParser, the code seems ugly but it finally worked!

https://github.com/Jisu-Woniu/digital-signature/blob/34e9fa99a2bedb7e6afd1b9bec9fa246ab798f56/src-tauri/crypto/src/signing.rs#L137-L143

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant