Class IAcmeContextExtensions
Extension methods for IAcmeContext.
Inheritance
Namespace: Certes
Assembly: Certes.dll
Syntax
public static class IAcmeContextExtensions
Methods
| Edit this page View SourceGetRenewalInfo(IAcmeContext, string, CancellationToken)
Gets the ACME Renewal Information (ARI) of a certificate, as defined in RFC 9773.
Declaration
public static Task<RenewalInfo> GetRenewalInfo(this IAcmeContext context, string certificateId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| IAcmeContext | context | The ACME context. |
| string | certificateId | The ARI certificate identifier, from GetRenewalInfoCertificateId(CertificateChain). |
| CancellationToken | cancellationToken | Cancels this operation. |
Returns
| Type | Description |
|---|---|
| Task<RenewalInfo> | The renewal information, including the suggested renewal window and the server-requested RetryAfter delay before polling again. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | If |
| NotSupportedException | If the server does not advertise a renewal information endpoint. |
| AcmeRequestException | If the server returns an error. |
| AcmeException | If the response or suggested window is missing, or the window ends at or before it starts. |
NewAccount(IAcmeContext, string, bool, string, string, string, CancellationToken)
Creates an account.
Declaration
public static Task<IAccountContext> NewAccount(this IAcmeContext context, string email, bool termsOfServiceAgreed = false, string eabKeyId = null, string eabKey = null, string eabKeyAlg = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| IAcmeContext | context | The ACME context. |
| string | The email. |
|
| bool | termsOfServiceAgreed | Set to |
| string | eabKeyId | Optional key identifier for external account binding |
| string | eabKey | Optional key for use with external account binding |
| string | eabKeyAlg | Optional key algorithm e.g HS256, for external account binding |
| CancellationToken | cancellationToken | Cancels this operation. |
Returns
| Type | Description |
|---|---|
| Task<IAccountContext> | The account created. |
NewOrder(IAcmeContext, IList<Identifier>, DateTimeOffset?, DateTimeOffset?, CancellationToken)
Creates a new order with explicitly typed identifiers, for example IP addresses (RFC 8738).
Declaration
public static Task<IOrderContext> NewOrder(this IAcmeContext context, IList<Identifier> identifiers, DateTimeOffset? notBefore = null, DateTimeOffset? notAfter = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| IAcmeContext | context | The ACME context. |
| IList<Identifier> | identifiers | The DNS or IP identifiers. IP values are normalized to their canonical text form. |
| DateTimeOffset? | notBefore | The value of not before field for the certificate. |
| DateTimeOffset? | notAfter | The value of not after field for the certificate. |
| CancellationToken | cancellationToken | Cancels this operation. |
Returns
| Type | Description |
|---|---|
| Task<IOrderContext> | The order context created. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | An identifier is missing, empty, or not a valid IP address for type Ip. |
NewOrderWithProfile(IAcmeContext, IList<Identifier>, string, DateTimeOffset?, DateTimeOffset?, string, bool, CancellationToken)
Creates an order with explicitly typed identifiers using an advertised certificate profile. Some CAs, such as Let's Encrypt, issue IP address certificates only under specific profiles.
Declaration
public static Task<IOrderContext> NewOrderWithProfile(this IAcmeContext context, IList<Identifier> identifiers, string profile, DateTimeOffset? notBefore = null, DateTimeOffset? notAfter = null, string replacedCertificateId = null, bool allowUnadvertisedProfile = false, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| IAcmeContext | context | The ACME context. |
| IList<Identifier> | identifiers | The DNS or IP identifiers. |
| string | profile | The exact, case-sensitive profile name advertised in directory metadata. |
| DateTimeOffset? | notBefore | The requested certificate validity start. |
| DateTimeOffset? | notAfter | The requested certificate validity end. |
| string | replacedCertificateId | Optional ARI identifier of the certificate being replaced. |
| bool | allowUnadvertisedProfile | Set to |
| CancellationToken | cancellationToken | Cancels this operation. |
Returns
| Type | Description |
|---|---|
| Task<IOrderContext> | The created order context. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | The profile, an identifier, or the replacement ID is empty or malformed, or the profile is not advertised. |
| NotSupportedException | The server does not advertise profiles or a new-order endpoint. |
| AcmeRequestException | The server rejects the order, for example with invalidProfile. |
NewOrderWithProfile(IAcmeContext, IList<string>, string, DateTimeOffset?, DateTimeOffset?, string, bool, CancellationToken)
Creates an order using an advertised certificate profile.
Declaration
public static Task<IOrderContext> NewOrderWithProfile(this IAcmeContext context, IList<string> identifiers, string profile, DateTimeOffset? notBefore = null, DateTimeOffset? notAfter = null, string replacedCertificateId = null, bool allowUnadvertisedProfile = false, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| IAcmeContext | context | The ACME context. |
| IList<string> | identifiers | The identifiers. Values that parse as IP addresses are sent as IP identifiers; others as DNS. |
| string | profile | The exact, case-sensitive profile name advertised in directory metadata. |
| DateTimeOffset? | notBefore | The requested certificate validity start. |
| DateTimeOffset? | notAfter | The requested certificate validity end. |
| string | replacedCertificateId | Optional ARI identifier of the certificate being replaced. |
| bool | allowUnadvertisedProfile | Set to |
| CancellationToken | cancellationToken | Cancels this operation. |
Returns
| Type | Description |
|---|---|
| Task<IOrderContext> | The created order context. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | The profile is empty or not advertised, or the replacement ID is malformed. |
| NotSupportedException | The server does not advertise profiles or a new-order endpoint. |
| AcmeRequestException | The server rejects the order, for example with invalidProfile. |
NewReplacementOrder(IAcmeContext, IList<Identifier>, string, DateTimeOffset?, DateTimeOffset?, CancellationToken)
Creates a new order with explicitly typed identifiers (for example, IP addresses per RFC 8738) that replaces a previously issued certificate, as defined in RFC 9773.
Declaration
public static Task<IOrderContext> NewReplacementOrder(this IAcmeContext context, IList<Identifier> identifiers, string replacedCertificateId, DateTimeOffset? notBefore = null, DateTimeOffset? notAfter = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| IAcmeContext | context | The ACME context. |
| IList<Identifier> | identifiers | The DNS or IP identifiers. |
| string | replacedCertificateId | The ARI certificate identifier of the certificate being replaced. |
| DateTimeOffset? | notBefore | The value of not before field for the certificate. |
| DateTimeOffset? | notAfter | The value of not after field for the certificate. |
| CancellationToken | cancellationToken | Cancels this operation. |
Returns
| Type | Description |
|---|---|
| Task<IOrderContext> | The order context created. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | An identifier or |
NewReplacementOrder(IAcmeContext, IList<string>, string, DateTimeOffset?, DateTimeOffset?, CancellationToken)
Creates a new order that replaces a previously issued certificate, as defined in RFC 9773.
Declaration
public static Task<IOrderContext> NewReplacementOrder(this IAcmeContext context, IList<string> identifiers, string replacedCertificateId, DateTimeOffset? notBefore = null, DateTimeOffset? notAfter = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| IAcmeContext | context | The ACME context. |
| IList<string> | identifiers | The identifiers. Values that parse as IP addresses are sent as IP identifiers; others as DNS. |
| string | replacedCertificateId | The ARI certificate identifier of the certificate being replaced, from GetRenewalInfoCertificateId(CertificateChain). |
| DateTimeOffset? | notBefore | The value of not before field for the certificate. |
| DateTimeOffset? | notAfter | The value of not after field for the certificate. |
| CancellationToken | cancellationToken | Cancels this operation. |
Returns
| Type | Description |
|---|---|
| Task<IOrderContext> | The order context created. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | If |
TermsOfService(IAcmeContext, CancellationToken)
Gets the terms of service link from the ACME server.
Declaration
public static Task<Uri> TermsOfService(this IAcmeContext context, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| IAcmeContext | context | The ACME context. |
| CancellationToken | cancellationToken | Cancels this operation. |
Returns
| Type | Description |
|---|---|
| Task<Uri> | The terms of service link. |