Closed
Description
Is it intended behavior that after calling:
let key_info = PrivateKeyInfo::try_from(key_der_bytes).unwrap();
that the private_key
field is still DER encoded?
I had to debug for a few hours until I realized that I didn't get the raw key from the field but that it was still prefixed with the Tag
and Length
bytes.
I would gladly open a PR to document this behavior but I wanted to first make sure what I'm seeing is as intended.
For anyone finding this in the future: Calling
let private_key: &[u8] = OctetStringRef::from_der(key_info.private_key).unwrap().into();
gave me the actual private key.
Thanks in advance!
Metadata
Metadata
Assignees
Labels
No labels