Hi there, I am developing a binary serialization w...
# serialization
v
Hi there, I am developing a binary serialization with kotlinx.serialization framework. I am currently stuck with serializing public keys (likely because it is an interface). The issue is that I can always serialize a public key, but to deserialize I need to know what kind of key this is. I did achieve such functionality using surrogates (as in docs) in simple cases such as 
class User(val id: PublicKey)
 but it does fail with generics 
class<T> User(val id: T)
 .  I get 
Class 'RSAPublicKeyImpl' is not registered for polymorphic serialization in the scope of 'PublicKey'.
 when I insert a public key instance there. My minimally working example is here https://github.com/vnermolaev/serde Does anyone have experience with kotlinx.serialization and applying it together with generics?