Closed VictorKoenders closed 4 years ago
I think this would be a great feature, but the serde support in the underlying library will probably change soon, because it was implemented suboptimally/incorrectly: https://github.com/dalek-cryptography/curve25519-dalek/issues/265
I have been very busy with a work project for the last few weeks, but I am hoping to close it out this Friday, so we could possibly revisit this issue next week?
This is just a minor thing I thought could improve. Don't worry about implementing this if you have things to do in real life, that obviously has priority. I'll look at the curve change and after that's implemented I'll revisit this issue.
Closed by #48 :)
It would be nice if the
PublicKey
would deriveserde::Serialize
andserde::Deserialize
. Serde is the most used serialization library for Rust, and is presumably used a lot in network communication.Serde support would change the following code:
To:
Which is slightly nicer to work with.
This could also be implemented for
StaticSecret
, as this is intended to be able to be saved and loaded.I'd suggest adding a feature called
serde
, which enables/disables theserde
dependency and is disabled by default. When this feature is enabled,PublicKey
implementsserde::Serialize
andserde::Deserialize
.I can implement this if you want me to.