Lasse Edslev
Lasse Edslev
> Since all of these have a straightforward serialization to bytes, it would be good to use that, rather than custom derive. > > @dignifiedquire perhaps we should use the...
> perhaps we should use the `serdect` So kinda like this? ```Rust impl Serialize for Signature { fn serialize(&self, serializer: S) -> core::result::Result where S: serdect::serde::Serializer, { serdect::slice::serialize_hex_lower_or_bin(&self.inner.to_bytes_be(), serializer) }...
I guess only `Signature` has a straight forward `serdect` implementation, since the other structs rely on `RsaPublicKey`, `RsaPrivateKey` and more, so that's gonna have to do for now.
@tarcieri I see, I'll give it a whirl
`RsaPublicKey`, `RsaPrivateKey` and the structs in `pkcs1v15` now have the `serdect` implementations
Should I add some `serde_test` tests like the `key::tests::test_serde` test for the new implementations?
Due to the `PhantomData` fields that has `D: Digest`, I can't use `PartialEq` on all the structs and therefore I can't use `serde_test::assert_tokens`. I could not find a better solution...
> Can you post the code that isn’t working? For the `oaep::EncryptingKey` which uses the `D: Digest` generic I tried something like this: ```Rust #[test] #[cfg(feature = "serde")] fn test_serde()...
Now all of them have the `serde_test` tests
So what's next?