From 695fafad7f158d0357f4e28b434fdf44db66a5cd Mon Sep 17 00:00:00 2001 From: Eddie Lin Date: Thu, 22 Dec 2016 09:47:32 -0500 Subject: [PATCH] add interface for acme client --- src/Certes/IAcmeClient.cs | 89 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 src/Certes/IAcmeClient.cs diff --git a/src/Certes/IAcmeClient.cs b/src/Certes/IAcmeClient.cs new file mode 100644 index 00000000..2584a1af --- /dev/null +++ b/src/Certes/IAcmeClient.cs @@ -0,0 +1,89 @@ +using System; +using System.Threading.Tasks; +using Certes.Acme; +using Certes.Pkcs; + +namespace Certes +{ + /// + /// Represents a ACME client. + /// + public interface IAcmeClient + { + /// + /// Submits the challenge for the ACME server to validate. + /// + /// The authentication challenge. + /// The challenge updated. + Task> CompleteChallenge(Challenge authChallenge); + + /// + /// Computes the DNS value for the . + /// + /// The challenge. + /// The value for the text DNS record. + string ComputeDnsValue(Challenge challenge); + + /// + /// Computes the key authorization string for . + /// + /// The challenge. + /// The key authorization string. + string ComputeKeyAuthorization(Challenge challenge); + + /// + /// Gets the authorization from . + /// + /// The authorization location URI. + /// The authorization retrieved. + Task> GetAuthorization(Uri location); + + /// + /// Create a new authorization. + /// + /// The identifier to be authorized. + /// The authorization created. + Task> NewAuthorization(AuthorizationIdentifier identifier); + + /// + /// Creates a new certificate. + /// + /// The certificate signing request (CSR) provider. + /// The certificate issued. + Task NewCertificate(ICertificationRequestBuilder csrProvider); + + /// + /// Creates a new certificate. + /// + /// The certificate signing request data. + /// The certificate issued. + Task NewCertificate(byte[] csrBytes); + + /// + /// Creates a new registraton. + /// + /// The contact method, e.g. mailto:admin@example.com. + /// The ACME account created. + Task NewRegistraton(params string[] contact); + + /// + /// Revokes the certificate. + /// + /// The certificate. + /// The certificate revoked. + Task RevokeCertificate(AcmeCertificate certificate); + + /// + /// Updates the registration. + /// + /// The account to update. + /// The updated ACME account. + Task UpdateRegistration(AcmeAccount account); + + /// + /// Uses the specified account key data. + /// + /// The account key data. + void Use(KeyInfo keyData); + } +} \ No newline at end of file