Class AcmeContext
Represents the context for ACME operations.
Inheritance
Namespace: Certes
Assembly: Certes.dll
Syntax
public class AcmeContext : IAcmeContext
Constructors
| Edit this page View SourceAcmeContext(Uri, IKey, IAcmeHttpClient, int)
Initializes a new instance of the AcmeContext class.
Declaration
public AcmeContext(Uri directoryUri, IKey accountKey = null, IAcmeHttpClient http = null, int badNonceRetryCount = 1)
Parameters
| Type | Name | Description |
|---|---|---|
| Uri | directoryUri | The directory URI. |
| IKey | accountKey | The account key. |
| IAcmeHttpClient | http | The HTTP client. |
| int | badNonceRetryCount | The number of retries on a bad nonce. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | If |
Properties
| Edit this page View SourceAccountKey
Gets the account key.
Declaration
public IKey AccountKey { get; }
Property Value
| Type | Description |
|---|---|
| IKey | The account key. |
BadNonceRetryCount
Gets the number of retries on a badNonce error.
Declaration
public int BadNonceRetryCount { get; }
Property Value
| Type | Description |
|---|---|
| int | The number of retries. |
DirectoryUri
Gets the directory URI.
Declaration
public Uri DirectoryUri { get; }
Property Value
| Type | Description |
|---|---|
| Uri | The directory URI. |
HttpClient
Gets the ACME HTTP client.
Declaration
public IAcmeHttpClient HttpClient { get; }
Property Value
| Type | Description |
|---|---|
| IAcmeHttpClient | The ACME HTTP client. |
Methods
| Edit this page View SourceAccount(CancellationToken)
Gets the ACME account context.
Declaration
public Task<IAccountContext> Account(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<IAccountContext> | The ACME account context. |
Authorization(Uri)
Gets the authorization by specified location.
Declaration
public IAuthorizationContext Authorization(Uri location)
Parameters
| Type | Name | Description |
|---|---|---|
| Uri | location | The authorization location. |
Returns
| Type | Description |
|---|---|
| IAuthorizationContext | The authorization context. |
ChangeKey(IKey, CancellationToken)
Changes the account key.
Declaration
public Task<Account> ChangeKey(IKey key, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| IKey | key | The new account key. |
| CancellationToken | cancellationToken | Cancels this operation. |
Returns
| Type | Description |
|---|---|
| Task<Account> | The account resource. |
GetDirectory(CancellationToken)
Gets the ACME directory.
Declaration
public Task<Directory> GetDirectory(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<Directory> | The ACME directory. |
NewAccount(IList<string>, bool, string, string, string, CancellationToken)
Creates the account.
Declaration
public Task<IAccountContext> NewAccount(IList<string> contact, bool termsOfServiceAgreed, string eabKeyId = null, string eabKey = null, string eabKeyAlg = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| IList<string> | contact | |
| bool | termsOfServiceAgreed | |
| string | eabKeyId | |
| string | eabKey | |
| string | eabKeyAlg | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<IAccountContext> | The account created. |
NewOrder(IList<string>, DateTimeOffset?, DateTimeOffset?, CancellationToken)
Creates a new the order.
Declaration
public Task<IOrderContext> NewOrder(IList<string> identifiers, DateTimeOffset? notBefore = null, DateTimeOffset? notAfter = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| IList<string> | identifiers | The identifiers. Values that strictly parse as IP addresses are sent as IP identifiers (RFC 8738) in canonical form; all others are sent as DNS identifiers. |
| DateTimeOffset? | notBefore | Th 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. |
Order(Uri)
Gets the order by specified location.
Declaration
public IOrderContext Order(Uri location)
Parameters
| Type | Name | Description |
|---|---|---|
| Uri | location | The order location. |
Returns
| Type | Description |
|---|---|
| IOrderContext | The order context. |
RevokeCertificate(byte[], RevocationReason, IKey, CancellationToken)
Revokes the certificate.
Declaration
public Task RevokeCertificate(byte[] certificate, RevocationReason reason, IKey certificatePrivateKey, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | certificate | The certificate in DER format. |
| RevocationReason | reason | The reason for revocation. |
| IKey | certificatePrivateKey | The certificate's private key. |
| CancellationToken | cancellationToken | Cancels this operation. |
Returns
| Type | Description |
|---|---|
| Task | The awaitable. |
Sign(object, Uri, CancellationToken)
Signs the data with account key.
Declaration
public Task<JwsPayload> Sign(object entity, Uri uri, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| object | entity | The data to sign. |
| Uri | uri | The URI for the request. |
| CancellationToken | cancellationToken | Cancels this operation. |
Returns
| Type | Description |
|---|---|
| Task<JwsPayload> | The JWS payload. |