Currently, there is separate copy of PrivateKeyInfo in RSA and ECC code, handling the wrapping and unwrapping of private keys.
Simo suggested that this would be something that could be used with #defined_by(OID) of rust-asn1 library to provide generic structure. The WIP branch implementing this is available here (but still has some memory ownership issues to resolve):
Currently, there is separate copy of PrivateKeyInfo in RSA and ECC code, handling the wrapping and unwrapping of private keys.
Simo suggested that this would be something that could be used with
#defined_by(OID)
of rust-asn1 library to provide generic structure. The WIP branch implementing this is available here (but still has some memory ownership issues to resolve):https://github.com/Jakuje/kryoptic/commits/defined-by/
[defined_by(private_key_algorithm)]
See: https://docs.rs/asn1/latest/asn1/#defined-by
_Originally posted by @simo5 in https://github.com/latchset/kryoptic/pull/5#discussion_r1507927653_