Class AcmeAccount

    • Method Detail

      • getContactUrls

        public String[] getContactUrls()
        Get the account contact URLs.
        Returns:
        the contact URLs
      • setContactUrls

        public void setContactUrls​(String[] contactUrls)
        Set the account contact URLs.
        Parameters:
        contactUrls - the contact URLs (must not be null)
      • isTermsOfServiceAgreed

        public boolean isTermsOfServiceAgreed()
        Return whether or not the ACME server's terms of service have been agreed to.
        Returns:
        whether or not the ACME server's terms of service have been agreed to
      • setTermsOfServiceAgreed

        public void setTermsOfServiceAgreed​(boolean termsOfServiceAgreed)
        Set whether the terms of services have been agreed to.
        Parameters:
        termsOfServiceAgreed - whether or not the ACME server's terms of service have been agreed to
      • getServerUrl

        public String getServerUrl()
        Get the ACME server URL.
        Returns:
        the ACME server URL
      • getServerUrl

        public String getServerUrl​(boolean staging)
        Get the ACME server URL.
        Parameters:
        staging - whether or not the ACME staging server should be returned
        Returns:
        the ACME server URL
      • getStagingServerUrl

        public String getStagingServerUrl()
        Get the ACME staging server URL.
        Returns:
        the ACME staging server URL
      • getPrivateKey

        public PrivateKey getPrivateKey()
        Get the account private key.
        Returns:
        the account private key
      • getPublicKey

        public PublicKey getPublicKey()
        Get the account public key.
        Returns:
        the account public key
      • getCertificate

        public X509Certificate getCertificate()
        Get the X.509 certificate that contains the account public key.
        Returns:
        the X.509 certificate that contains the account public key
      • getDn

        public X500Principal getDn()
        Get the DN from the X.509 certificate that contains the account public key.
      • getAlgHeader

        public String getAlgHeader()
        Get the JWS "alg" header parameter value for this account.
        Returns:
        the JWS "alg" header parameter value for this account
      • getSignature

        public Signature getSignature()
        Get a signature instance for this account.
        Returns:
        a signature instance for this account
      • getKeySize

        public int getKeySize()
        Get the key size.
        Returns:
        the key size
      • getKeyAlgorithmName

        public String getKeyAlgorithmName()
        Get the key algorithm name.
        Returns:
        the key algorithm name
      • getAccountUrl

        public String getAccountUrl()
        Return the account location URL or null if this account has not yet been successfully registered with the ACME server.
        Returns:
        the account location URL or null if this account has not yet been successfully registered with the ACME server
      • setAccountUrl

        public void setAccountUrl​(String accountUrl)
        Set the account location URL provided by the ACME server.
        Parameters:
        accountUrl - the account location URL (must not be null)
      • getResourceUrl

        public URL getResourceUrl​(AcmeResource resource,
                                  boolean staging)
        Get the URL for the given ACME resource.
        Parameters:
        resource - the ACME resource (must not be null)
        staging - whether or not the ACME staging server should be used
        Returns:
        the URL for the given ACME resource
      • getResourceUrls

        public Map<AcmeResource,​URL> getResourceUrls​(boolean staging)
        Get the ACME resource URLs.
        Parameters:
        staging - whether or not the ACME staging server should be used
        Returns:
        the ACME resource URLs
      • getNonce

        public byte[] getNonce()
        Get the current nonce for this account.
        Returns:
        the current nonce for this account
      • setNonce

        public void setNonce​(byte[] nonce)
        Set the new nonce for this account.
        Parameters:
        nonce - the new nonce for this account (must not be null)
      • changeCertificateAndPrivateKey

        public void changeCertificateAndPrivateKey​(X509Certificate certificate,
                                                   PrivateKey privateKey)
        Change the certificate and private key associated with this account.
        Parameters:
        certificate - the new certificate (must not be null)
        privateKey - the new private key (must not be null)
      • builder

        public static AcmeAccount.Builder builder()
        Construct a new builder instance.
        Returns:
        the new builder instance