tonic icon indicating copy to clipboard operation
tonic copied to clipboard

add support for parsing X509 certs from DER

Open cristiano-prato opened this issue 6 months ago • 1 comments

tls: allow creation of Certificate and Identity from DER

Adds Certificate::from_der and Identity::from_der constructors to allow creation of Certificate and Identity from DER-encoded data.

Fixes: #2343 Fixes: #2344

Motivation

PEM and DER are both very common encoding formats for X509 certificates.

Solution

Convert DER certificates to PEM to prevent changes to the rest of the crate. The conversion is done following RFC 7468, which basically means converting the DER in base64 and adding the proper header and footer.

cristiano-prato avatar Aug 05 '25 13:08 cristiano-prato

Thank you for writing patches to address these two issues.

strangelittlemonkey avatar Sep 23 '25 03:09 strangelittlemonkey