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

Add support for Origin CA certificates #89

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

Conversation

GerardSmit
Copy link
Contributor

@GerardSmit GerardSmit commented Feb 28, 2024

This PR adds support for Origin CA certificates.

API documentation

Usage example:

using RSA key = RSA.Create(2048);

string domain = "example.com";

CertificateRequest request = new CertificateRequest(
    $"CN={domain}",
    key,
    HashAlgorithmName.SHA256,
    RSASignaturePadding.Pkcs1);

CloudFlareResult<Certificate> result = await client.Certificates.AddAsync(new NewCertificate
{
    CertificateSigningRequest = request.CreateSigningRequestPem(),
    Hostnames = [$"*.{domain}", domain],
    RequestType = CertificateType.OriginRsa
});

X509Certificate2 originCertificate = new X509Certificate2(Encoding.UTF8.GetBytes(result.Result.OriginCertificate));
X509Certificate2 certificate = originCertificate.CopyWithPrivateKey(key);

Repository owner deleted a comment from sonarqubecloud bot Dec 21, 2024
Repository owner deleted a comment from sonarqubecloud bot Dec 22, 2024
Repository owner deleted a comment from sonarqubecloud bot Dec 27, 2024
Copy link

sonarqubecloud bot commented Jan 2, 2025

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.

2 participants