Class DnsPersist01Challenge

All Implemented Interfaces:
Serializable, PollableResource

public class DnsPersist01Challenge extends Challenge
Implements the "dns-persist-01" challenge. It requires a specific DNS record for domain validation. See the acme4j documentation for a detailed explanation.
Since:
5.0.0
See Also:
Draft:
This class is currently based on an RFC draft. It may be changed or removed without notice to reflect future changes to the draft. SemVer rules do not apply here.
  • Field Details

  • Constructor Details

  • Method Details

    • getIssuerDomainNames

      Returns the list of issuer-domain-names from the CA. The list is guaranteed to have at least one element.
    • getRRName

      public String getRRName(Identifier identifier)
      Converts a domain identifier to the Resource Record name to be used for the DNS TXT record.
      Parameters:
      identifier - Domain Identifier of the domain to be validated
      Returns:
      Resource Record name (e.g. _validation-persist.www.example.org., note the trailing full stop character).
    • getRRName

      public String getRRName(String domain)
      Converts a domain identifier to the Resource Record name to be used for the DNS TXT record.
      Parameters:
      domain - Domain name to be validated
      Returns:
      Resource Record name (e.g. _validation-persist.www.example.org., note the trailing full stop character).
    • buildRData

      Returns a builder for the RDATA value of the DNS TXT record.
      Returns:
      Builder for the RDATA
    • getRData

      public String getRData()
      Convenience call to get a standard RDATA without optional tags.
      Returns:
      RRDATA
    • getAccountUrl

      public URL getAccountUrl()
      Returns the Account URI that is expected to request the validation.
      Since:
      5.1.0
    • invalidate

      protected void invalidate()
      Description copied from class: AcmeJsonResource
      Invalidates the state of this resource. Enforces a AcmeJsonResource.fetch() when AcmeJsonResource.getJSON() is invoked.

      Subclasses can override this method to purge internal caches that are based on the JSON structure. Remember to invoke super.invalidate()!

      Overrides:
      invalidate in class AcmeJsonResource
    • acceptable

      protected boolean acceptable(String type)
      Description copied from class: Challenge
      Checks if the type is acceptable to this challenge. This generic class only checks if the type is not blank. Subclasses should instead check if the given type matches expected challenge type.
      Overrides:
      acceptable in class Challenge
      Parameters:
      type - Type to check
      Returns:
      true if acceptable, false if not
    • setJSON

      protected void setJSON(JSON json)
      Description copied from class: AcmeJsonResource
      Sets the JSON representation of the resource data.
      Overrides:
      setJSON in class Challenge
      Parameters:
      json - New JSON data, must not be null.