2using System.Collections.Generic;
3using System.Threading.Tasks;
36 private readonly
string[] contact =
null;
37 private readonly
string initialIp =
null;
38 private readonly Uri orders =
null;
39 private readonly DateTime? createdAt =
null;
40 private readonly
bool? termsOfServiceAgreed =
null;
45 foreach (KeyValuePair<string, object> P
in Obj)
50 if (!Enum.TryParse(P.Value as
string, out
this.status))
51 throw new ArgumentException(
"Invalid ACME account status: " + P.Value.ToString(),
"status");
55 if (P.Value is Array A)
57 List<string>
Contact =
new List<string>();
59 foreach (
object Obj2
in A)
65 this.contact =
Contact.ToArray();
69 case "termsOfServiceAgreed":
71 this.termsOfServiceAgreed = b;
73 throw new ArgumentException(
"Invalid boolean value.",
"termsOfServiceAgreed");
77 this.orders =
new Uri(P.Value as
string);
81 this.initialIp = P.Value as string;
85 if (
XML.
TryParse(P.Value as
string, out DateTime TP))
88 throw new ArgumentException(
"Invalid date and time value.",
"createdAt");
151 return this.Client.
NewKey(this.Location);
161 public Task<AcmeOrder>
OrderCertificate(
string[] Domains, DateTime? NotBefore, DateTime? NotAfter)
163 int i, c = Domains.Length;
166 for (i = 0; i < c; i++)
167 Identifiers[i] =
new AcmeIdentifier(this.Client,
"dns", Domains[i]);
179 public Task<AcmeOrder>
OrderCertificate(
string Domain, DateTime? NotBefore, DateTime? NotAfter)
192 public Task<AcmeOrder>
OrderCertificate(
string Type,
string Value, DateTime? NotBefore, DateTime? NotAfter)
205 DateTime? NotBefore, DateTime? NotAfter)
218 DateTime? NotBefore, DateTime? NotAfter)
220 return this.Client.
OrderCertificate(this.Location, Identifiers, NotBefore, NotAfter);
228 if (this.orders is
null)
229 throw new Exception(
"Account object did not report a URI for the list of orders.");
231 return this.Client.
GetOrders(this.Location, this.orders);
Helps with parsing of commong data types.
static bool TryParse(string s, out double Value)
Tries to decode a string encoded double.
Helps with common XML-related tasks.
static bool TryParse(string s, out DateTime Value)
Tries to decode a string encoded DateTime.
Represents an ACME account.
Task< AcmeOrder > OrderCertificate(string Domain, DateTime? NotBefore, DateTime? NotAfter)
Orders certificate.
Task< AcmeAccount > NewKey()
Creates a new key for the account.
Task< AcmeOrder > OrderCertificate(string[] Domains, DateTime? NotBefore, DateTime? NotAfter)
Orders certificate.
string[] Contact
Optional array of URLs that the server can use to contact the client for issues related to this accou...
Uri Orders
A URL from which a list of orders submitted by this account can be fetched via a GET request
DateTime? CreatedAt
Date and time of creation, if available.
Task< AcmeAccount > Update(string[] Contact)
Updates the account.
bool? TermsOfServiceAgreed
Including this field in a new-account request, with a value of true, indicates the client's agreement...
string InitialIp
Initial IP address.
AcmeAccountStatus Status
The status of this account.
Task< AcmeOrder > OrderCertificate(AcmeIdentifier Identifier, DateTime? NotBefore, DateTime? NotAfter)
Orders certificate.
Task< AcmeOrder > OrderCertificate(AcmeIdentifier[] Identifiers, DateTime? NotBefore, DateTime? NotAfter)
Orders certificate.
Task< AcmeOrder[]> GetOrders()
Gets the list of current orders.
Task< AcmeOrder > OrderCertificate(string Type, string Value, DateTime? NotBefore, DateTime? NotAfter)
Orders certificate.
Task< AcmeAccount > Deactivate()
Deactivates the account.
Implements an ACME client for the generation of certificates using ACME-compliant certificate servers...
async Task< AcmeAccount > NewKey(Uri AccountLocation)
Generates a new key for the account. (Account keys are managed by the CSP.)
async Task< AcmeOrder > OrderCertificate(Uri AccountLocation, AcmeIdentifier[] Identifiers, DateTime? NotBefore, DateTime? NotAfter)
Orders certificate.
async Task< AcmeAccount > UpdateAccount(Uri AccountLocation, string[] Contact)
Updates an account.
async Task< AcmeOrder[]> GetOrders(Uri AccountLocation, Uri OrdersLocation)
Gets the list of current orders for an account.
async Task< AcmeAccount > DeactivateAccount(Uri AccountLocation)
Deactivates an account.
Represents an ACME identifier.
AcmeClient Client
ACME client.
Abstract base class for all ACME resources.
Uri Location
Location of resource.
AcmeAccountStatus
ACME Account status enumeration