rusticata / x509-parser

X.509 parser written in pure Rust. Fast, zero-copy, safe.
Other
215 stars 68 forks source link

Expose TbsCertificate::raw, TbsCertificate::raw_serial #91

Closed SergioBenitez closed 3 years ago

SergioBenitez commented 3 years ago

TbsCertificate::raw is required to verify signatures externally. The bytes passed to the parse function (thus available to the consumer of this API) may not coincide with TbsCertificate::raw when parsing consumes only some of the bytes. As such, exposing this field is necessary.

I've also exposed TbsCertificate::raw_serial, for parity.

chifflier commented 3 years ago

Closing, these fields are already accessible using x509.tbs_certificate.as_ref() (for raw) and x509.tbs_certificate.raw_serial(). This may require some documentation, though. Thanks!