Skip to content
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

RequestCertificateAsync always fails with parameters containing csr. #7

Open
garethvdl2 opened this issue Oct 31, 2024 · 2 comments
Open

Comments

@garethvdl2
Copy link

I am using

public async Task<X509Certificate2?> RequestCertificateAsync(
AvailableCAModel ca,
string csr,
string subjectName,
int certificateValidityDays
)
It always fails in the _httpClient.CallGenericAsync() request as I am unable to provide subjectAlternateNames.
The parameters should be similar to RequestCertificateWithChainAsync.

Thanks

@igalfsg
Copy link
Contributor

igalfsg commented Oct 31, 2024

Hi what parameters are you adding? what is the error you are getting?

@garethvdl2
Copy link
Author

Hi Igal

var domain = "DeviceId";
RSA key = RSA.Create(4096);
X500DistinguishedName x500DistinguishedName = new("CN=" + domain);
CertificateRequest certificateRequest = new(x500DistinguishedName, key, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
string csr = CryptoStaticService.PemEncodeSigningRequest(certificateRequest);
X509Certificate2? cert = await ezcaClient.RequestCertificateAsync(selectedCA, csr, domain, 7);

The REST request returns with no subjectAlternateNames

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

No branches or pull requests

2 participants