peerbit
peerbit copied to clipboard
`Crypto`: Should `Key` be serializable?
trafficstars
Currently you can not do
@field({type: Key})
key: PublicSignKey | PublicKeyEncryptionKey
only
@field({type: PublicSignKey})
key: PublicSignKey
Pros:
- Above example can be done
Cons:
- The serialized key will be more complicated, i.e. an additional discriminator and more deserialization paths (performance?)
- Composition patterns are better than inheritance. You can create your own crypto wrappers for serializing