Provide `as_raw` for all DER components?
This is the tracking issue for ideas discussed with @g2p in #35: can the parser expose the raw bytes for all components?
Maybe a possibility is to use something like nom-locate to parse items while tracking location in the input stream.
Hey! I would love to have this API. Would you please implement it?
This would be very helpful to extract the DER-serialization of individual certificate components - in my case, having access to the DER-encoding of SubjectPublicKeyInfo would be great to achieve interoperability with another crate.
in my case, having access to the DER-encoding of SubjectPublicKeyInfo would be great to achieve interoperability with another crate.
@nthuemmel-scontain For this particular use case you should be able to use the raw field of the SubjectPublicKeyInfo struct:
A raw unparsed PKIX, ASN.1 DER form (see RFC 5280, Section 4.1).
@nthuemmel-scontain For this particular use case you should be able to use the
rawfield of theSubjectPublicKeyInfostruct:
Thank you! You are right! For some reason, I assumed raw would cover only the subject_public_key, but it does indeed also cover the algorithm identifier. I guess I got confused by the mention of the parsed() method in the docs. (My assumption being that algorithm and subject_public_key cannot be the parsed equivalent of raw if there exists a separate fallible parsed() method.)