Really appreciate the positive feedback! I’ve written a bit about typesafe keys here if you’re interested. And if you really wanna go down the rabbit hole, you can look at the EncryptedManifest type I built for Ark:
A Scratchpad
-backed encrypted data type that requires four specific public keys for encryption, but can be decrypted with any single one of their secret-key equivalents. All enforced by the compiler and with minimal boiler plate code. Any valid key type automatically has a decrypt_manifest
function that accepts the ciphertext and returns a decrypted, deserialized and validated Manifest
instance. It’s almost impossible to use incorrectly.
I bumped into some current limitations of Rust’s type system when implementing all of that. Nightly
would have helped, but I want Ark to build on Stable
, so I wrote some small macros to keep the boilerplate low.
For all the things that are great about Rust, is still has a fair number of rough edges and limitations, especially when trying some more advanced stuff. I can’t count how many times I’ve come across some problem whose solution has been in development since 2018 but has completely stalled. I truly wish the Rust Project would get some paid, full-time PMs that simply go through all the old, open issues and push them to completion.