Class AcmeAccount.Builder

java.lang.Object
org.wildfly.security.x500.cert.acme.AcmeAccount.Builder
Enclosing class:
AcmeAccount

public static class AcmeAccount.Builder extends Object
  • Field Details

    • DEFAULT_ACCOUNT_KEY_ALGORITHM_NAME

      public static final String DEFAULT_ACCOUNT_KEY_ALGORITHM_NAME
      The default account key algorithm name.
      See Also:
    • DEFAULT_ACCOUNT_KEY_SIZE

      public static final int DEFAULT_ACCOUNT_KEY_SIZE
      The default account key size that will be used if the key algorithm name is not EC.
      See Also:
    • DEFAULT_ACCOUNT_EC_KEY_SIZE

      public static final int DEFAULT_ACCOUNT_EC_KEY_SIZE
      The default account key size that will be used if the key algorithm name is EC.
      See Also:
  • Method Details

    • setContactUrls

      public AcmeAccount.Builder setContactUrls(String[] contactUrls)
      Set the contact URLs.
      Parameters:
      contactUrls - the contact URLs (must not be null)
      Returns:
      this builder instance
    • setTermsOfServiceAgreed

      public AcmeAccount.Builder setTermsOfServiceAgreed(boolean termsOfServiceAgreed)
      Set if the terms of service of the ACME server have been agreed to.
      Parameters:
      termsOfServiceAgreed - whether or not the ACME server's terms of service have been agreed to
      Returns:
      this builder instance
    • setServerUrl

      public AcmeAccount.Builder setServerUrl(String serverUrl)
      Set the URL of the ACME server endpoint.
      Parameters:
      serverUrl - the ACME server endpoint URL (must not be null)
      Returns:
      this builder instance
    • setStagingServerUrl

      public AcmeAccount.Builder setStagingServerUrl(String stagingServerUrl)
      Set the URL of the ACME staging server endpoint.
      Parameters:
      stagingServerUrl - the ACME staging server endpoint URL (must not be null)
      Returns:
      this builder instance
    • setKeyAlgorithmName

      public AcmeAccount.Builder setKeyAlgorithmName(String keyAlgorithmName)
      Set the key algorithm name to use when generating the account key pair.
      Parameters:
      keyAlgorithmName - the key algorithm name to use when generating the account key pair (must not be null)
      Returns:
      this builder instance
    • setKeySize

      public AcmeAccount.Builder setKeySize(int keySize)
      Set the key size to use when generating the account key pair.
      Parameters:
      keySize - the key size to use when generating the account key pair
      Returns:
      this builder instance
    • setDn

      Set the DN to use when generating the account key pair.
      Parameters:
      dn - the DN to use as both the subject DN and the issuer DN (must not be null)
      Returns:
      this builder instance
    • setKey

      public AcmeAccount.Builder setKey(X509Certificate certificate, PrivateKey privateKey)
      Set the account key pair.
      Parameters:
      certificate - the certificate (must not be null)
      privateKey - the key (must not be null)
      Returns:
      this builder instance
    • build

      public AcmeAccount build() throws IllegalArgumentException
      Create an ACME account.
      Returns:
      the newly created ACME account
      Throws:
      IllegalArgumentException - if a required builder parameter is missing or invalid