Skip to content

add support for parsing X509 certs from DER #2375

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

cristiano-prato
Copy link

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 and others added 3 commits August 5, 2025 15:22
fix: hyperium#2343 and hyperium#2344

Adds `Certificate::from_der` and `Identity::from_der` constructors
to allow creation of Certificate and Identity from DER-encoded data.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support to tonic::transport::Certificate from_der Add support to tonic::transport::Identity from_der
1 participant