- 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.TlsAlpn01Challenge
-
- All Implemented Interfaces:
Serializable
public class TlsAlpn01Challenge extends TokenChallenge
Implements the "tls-alpn-01" challenge. It requires a specific certificate that can be retrieved from the domain via HTTPS request. See the acme4j documentation for a detailed explanation.- Since:
- 2.1
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
ACME_TLS_1_PROTOCOL
acme-tls/1
protocol.static String
ACME_VALIDATION_OID
OID of theacmeValidation
extension.static String
TYPE
Challenge type name: "tls-alpn-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 TlsAlpn01Challenge(Login login, JSON data)
Creates a new genericTlsAlpn01Challenge
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
acceptable(String type)
Checks if the type is acceptable to this challenge.X509Certificate
createCertificate(KeyPair keypair, Identifier id)
Creates a self-signedX509Certificate
for this challenge.byte[]
getAcmeValidation()
Returns the value that is to be used asacmeValidation
extension in the test certificate.-
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: "tls-alpn-01"- See Also:
- Constant Field Values
-
ACME_VALIDATION_OID
public static final String ACME_VALIDATION_OID
OID of theacmeValidation
extension.- See Also:
- Constant Field Values
-
ACME_TLS_1_PROTOCOL
public static final String ACME_TLS_1_PROTOCOL
acme-tls/1
protocol.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TlsAlpn01Challenge
public TlsAlpn01Challenge(Login login, JSON data)
Creates a new genericTlsAlpn01Challenge
object.
-
-
Method Detail
-
getAcmeValidation
public byte[] getAcmeValidation()
Returns the value that is to be used asacmeValidation
extension in the test certificate.
-
createCertificate
public X509Certificate createCertificate(KeyPair keypair, Identifier id)
Creates a self-signedX509Certificate
for this challenge. The certificate is valid for 7 days.- Parameters:
keypair
- A domainKeyPair
to be used for the challengeid
- TheIdentifier
that is to be validated- Returns:
- Created certificate
- Since:
- 3.0.0
-
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
-
-