You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I'm currently building a small PoC using this Library and stumbled upon the following error:
I have generated three Certificates (Root, Intermediate,Leave) and key pairs.
The blockage reveals itself when I try to load the Intermediate Certificate.
From the public documentation I learned that I can load a certificate by deserializing the Certificate using CertificateParams::from_ca_cert_pem and signing it using CertificateParams::self_signed or CertificateParams::signed_by.
In my case self signing the certificate would break the chain and I don't have access to the root private key to sign the intermediary on every restart of the server.
In the Issues I've learned that there was a Certificate::from_pem that should satisfy my case but got it removed.
How can I load an existing CA Certificate without 'resigning' it?
Thanks
Paul
The text was updated successfully, but these errors were encountered:
In my case self signing the certificate would break the chain and I don't have access to the root private key to sign the intermediary on every restart of the server.
You're right that this area of the library is a little tricky to navigate right now.
I think the workaround for now is that the signature on the intermediate Certificate you use to sign isn't actually used when signing the leaf certificate, so it's actually fine to sign the intermediate with a random KeyPair if the resulting Certificate is actually only used to then sign the leaf certificate -- this intermediate Certificate wouldn't be able to be verified by clients that are actually verifying its signature against your root certificate, but only its params are being used to sign the leaf certificate anyway, and those are legit (since they originated from parsing the actual intermediate).
Does that make sense? We definitely need to improve the API in this area and it's something I've been working on but ran out of time to get done before the 0.13 release.
djc
changed the title
Deserializing an Intermediate Certificate
Signing leaf certificates with parsed intermediate
Apr 18, 2024
Thanks, the "hack" works. I've only needed to manually modify the pem of the leaf certificate to include the original pem of the intermediary to complete the chain.
Hello,
I'm currently building a small PoC using this Library and stumbled upon the following error:
I have generated three Certificates (Root, Intermediate,Leave) and key pairs.
The blockage reveals itself when I try to load the Intermediate Certificate.
From the public documentation I learned that I can load a certificate by deserializing the Certificate using
CertificateParams::from_ca_cert_pem
and signing it usingCertificateParams::self_signed
orCertificateParams::signed_by
.In my case self signing the certificate would break the chain and I don't have access to the root private key to sign the intermediary on every restart of the server.
In the Issues I've learned that there was a
Certificate::from_pem
that should satisfy my case but got it removed.How can I load an existing CA Certificate without 'resigning' it?
Thanks
Paul
The text was updated successfully, but these errors were encountered: