Certes
Show / Hide Table of Contents

Class AcmeContext

Represents the context for ACME operations.

Inheritance
object
AcmeContext
Implements
IAcmeContext
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Certes
Assembly: Certes.dll
Syntax
public class AcmeContext : IAcmeContext

Constructors

| Edit this page View Source

AcmeContext(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 directoryUri is null.

Properties

| Edit this page View Source

AccountKey

Gets the account key.

Declaration
public IKey AccountKey { get; }
Property Value
Type Description
IKey

The account key.

| Edit this page View Source

BadNonceRetryCount

Gets the number of retries on a badNonce error.

Declaration
public int BadNonceRetryCount { get; }
Property Value
Type Description
int

The number of retries.

| Edit this page View Source

DirectoryUri

Gets the directory URI.

Declaration
public Uri DirectoryUri { get; }
Property Value
Type Description
Uri

The directory URI.

| Edit this page View Source

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 Source

Account(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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

Implements

IAcmeContext

Extension Methods

IAcmeContextExtensions.GetRenewalInfo(IAcmeContext, string, CancellationToken)
IAcmeContextExtensions.NewAccount(IAcmeContext, string, bool, string, string, string, CancellationToken)
IAcmeContextExtensions.NewOrder(IAcmeContext, IList<Identifier>, DateTimeOffset?, DateTimeOffset?, CancellationToken)
IAcmeContextExtensions.NewOrderWithProfile(IAcmeContext, IList<Identifier>, string, DateTimeOffset?, DateTimeOffset?, string, bool, CancellationToken)
IAcmeContextExtensions.NewOrderWithProfile(IAcmeContext, IList<string>, string, DateTimeOffset?, DateTimeOffset?, string, bool, CancellationToken)
IAcmeContextExtensions.NewReplacementOrder(IAcmeContext, IList<Identifier>, string, DateTimeOffset?, DateTimeOffset?, CancellationToken)
IAcmeContextExtensions.NewReplacementOrder(IAcmeContext, IList<string>, string, DateTimeOffset?, DateTimeOffset?, CancellationToken)
IAcmeContextExtensions.TermsOfService(IAcmeContext, CancellationToken)

See Also

IAcmeContext
  • Edit this page
  • View Source
© 2018 Certes Project
Back to top