Class Account

All Implemented Interfaces:
Serializable

public class Account extends AcmeJsonResource
Represents an account at the ACME server.
See Also:
  • Constructor Details

  • Method Details

    • getTermsOfServiceAgreed

      @Nullable public Boolean getTermsOfServiceAgreed()
      Returns if the user agreed to the terms of service.
      Returns:
      true if the user agreed to the terms of service. May be null if the server did not provide such an information.
    • getContacts

      public List<URI> getContacts()
      List of contact addresses (emails, phone numbers etc).
    • getStatus

      public Status getStatus()
      Returns the current status of the account.

      Possible values are: Status.VALID, Status.DEACTIVATED, Status.REVOKED.

    • hasExternalAccountBinding

      public boolean hasExternalAccountBinding()
      Returns true if the account is bound to an external non-ACME account.
      Since:
      2.8
    • getKeyIdentifier

      @Nullable public String getKeyIdentifier()
      Returns the key identifier of the external non-ACME account. If this account is not bound to an external account, null is returned instead.
      Since:
      2.8
    • getOrders

      Returns an Iterator of all Order belonging to this Account.

      Using the iterator will initiate one or more requests to the ACME server.

      Returns:
      Iterator instance that returns Order objects in no specific order. Iterator.hasNext() and Iterator.next() may throw AcmeProtocolException if a batch of authorization URIs could not be fetched from the server. Each Iterator instance may provide the Order objects in a different order.
    • newOrder

      Creates a builder for a new Order.
      Returns:
      OrderBuilder object
    • preAuthorizeDomain

      Pre-authorizes a domain. The CA will check if it accepts the domain for certification, and returns the necessary challenges.

      Some servers may not allow pre-authorization.

      It is not possible to pre-authorize wildcard domains.

      Parameters:
      domain - Domain name to be pre-authorized. IDN names are accepted and will be ACE encoded automatically.
      Returns:
      Authorization object for this domain
      Throws:
      AcmeException - if the server does not allow pre-authorization
      AcmeServerException - if the server allows pre-authorization, but will refuse to issue a certificate for this domain
    • preAuthorize

      public Authorization preAuthorize(Identifier identifier) throws AcmeException
      Pre-authorizes an Identifier. The CA will check if it accepts the identifier for certification, and returns the necessary challenges.

      Some servers may not allow pre-authorization.

      It is not possible to pre-authorize wildcard domains.

      Parameters:
      identifier - Identifier to be pre-authorized.
      Returns:
      Authorization object for this identifier
      Throws:
      AcmeException - if the server does not allow pre-authorization
      AcmeServerException - if the server allows pre-authorization, but will refuse to issue a certificate for this identifier
      Since:
      2.3
    • changeKey

      public void changeKey(KeyPair newKeyPair) throws AcmeException
      Changes the KeyPair associated with the account.

      After a successful call, the new key pair is used in the bound Session, and the old key pair can be disposed of.

      Parameters:
      newKeyPair - new KeyPair to be used for identifying this account
      Throws:
      AcmeException
    • deactivate

      public void deactivate() throws AcmeException
      Permanently deactivates an account. Related certificates may still be valid after account deactivation, and need to be revoked separately if neccessary.

      A deactivated account cannot be reactivated!

      Throws:
      AcmeException
    • modify

      Modifies the account data of the account.
      Returns:
      Account.EditableAccount where the account can be modified