I'm using fszlin/certes to generate LE certificates.
I've downloaded the latest staging issuer PEM from Lets Encrypt and converted it to a Base64 String.
byte[] base64PEM = Convert.FromBase64String(lePemContents);
However, when I attempt to add using:
pfxbuilder.AddIssuers(base64PEM);
and "building" the PFX, I'm getting an error:
"Can not find issuer 'C=US,O=(STAGING) Internet Security Research Group,CN=(STAGING) Doctored Durian Root CA X3' for certificate 'C=US,O=(STAGING) Let's Encrypt,CN=(STAGING) Artificial Apricot R3'."
Does this PEM have to be encoded in some special way for the pfxbuilder to build correctly and not return this error?
I have downloaded an encoded version (.cer) which does work from a third party, however, I'd like to use the PEM from LetsEncrypt so, should LE change it again, the code is set up to do the conversion without any third party involved.
I've also tried
lePemContents = lePemContents.Replace("-----BEGIN CERTIFICATE-----", "");
lePemContents = lePemContents.Replace("-----END CERTIFICATE-----", "");
lePemContents = lePemContents.Replace("\r\n", "");
Before the
Convert.FromBase64String(lePemContents);
with the same result.
What might I be missing? TIA