- java.lang.Object
-
- org.shredzone.acme4j.AcmeResource
-
- org.shredzone.acme4j.AcmeJsonResource
-
- org.shredzone.acme4j.challenge.Challenge
-
- org.shredzone.acme4j.challenge.TokenChallenge
-
- org.shredzone.acme4j.challenge.Dns01Challenge
-
- All Implemented Interfaces:
Serializable
public class Dns01Challenge extends TokenChallenge
Implements the "dns-01" challenge. It requires a specific DNS record for domain validation. See the acme4j documentation for a detailed explanation.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
RECORD_NAME_PREFIX
The prefix of the domain name to be used for the DNS TXT record.static String
TYPE
Challenge type name: "dns-01"-
Fields inherited from class org.shredzone.acme4j.challenge.TokenChallenge
KEY_TOKEN
-
Fields inherited from class org.shredzone.acme4j.challenge.Challenge
KEY_ERROR, KEY_STATUS, KEY_TYPE, KEY_URL, KEY_VALIDATED
-
-
Constructor Summary
Constructors Constructor Description Dns01Challenge(Login login, JSON data)
Creates a new genericDns01Challenge
object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
acceptable(String type)
Checks if the type is acceptable to this challenge.String
getDigest()
Returns the digest string to be set in the domain's_acme-challenge
TXT record.static String
toRRName(String domain)
Converts a domain identifier to the Resource Record name to be used for the DNS TXT record.static String
toRRName(Identifier identifier)
Converts a domain identifier to the Resource Record name to be used for the DNS TXT record.-
Methods inherited from class org.shredzone.acme4j.challenge.TokenChallenge
getAuthorization, getToken, keyAuthorizationFor
-
Methods inherited from class org.shredzone.acme4j.challenge.Challenge
getError, getStatus, getType, getValidated, prepareResponse, setJSON, trigger
-
Methods inherited from class org.shredzone.acme4j.AcmeJsonResource
fetch, getJSON, getRetryAfter, invalidate, isValid, setRetryAfter, update
-
Methods inherited from class org.shredzone.acme4j.AcmeResource
finalize, getLocation, getLogin, getSession, rebind
-
-
-
-
Field Detail
-
TYPE
public static final String TYPE
Challenge type name: "dns-01"- See Also:
- Constant Field Values
-
RECORD_NAME_PREFIX
public static final String RECORD_NAME_PREFIX
The prefix of the domain name to be used for the DNS TXT record.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Dns01Challenge
public Dns01Challenge(Login login, JSON data)
Creates a new genericDns01Challenge
object.
-
-
Method Detail
-
toRRName
public static String toRRName(Identifier identifier)
Converts a domain identifier to the Resource Record name to be used for the DNS TXT record.- Parameters:
identifier
- DomainIdentifier
of the domain to be validated- Returns:
- Resource Record name (e.g.
_acme-challenge.www.example.org.
, note the trailing full stop character). - Since:
- 2.14
-
toRRName
public static String toRRName(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.
_acme-challenge.www.example.org.
, note the trailing full stop character). - Since:
- 2.14
-
getDigest
public String getDigest()
Returns the digest string to be set in the domain's_acme-challenge
TXT record.
-
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 classChallenge
- Parameters:
type
- Type to check- Returns:
true
if acceptable,false
if not
-
-