public class GenericChallenge extends Object implements Challenge
Challenge
. It can be used as a base class for
actual challenge implemenation, but it is also used if the ACME server offers a
proprietary challenge that is unknown to acme4j.
Subclasses must override acceptable(String)
so it only
accepts the own type. respond(ClaimBuilder)
should be
overridden to put all required data to the response.
Modifier and Type | Field and Description |
---|---|
protected static String |
KEY_STATUS |
protected static String |
KEY_TYPE |
protected static String |
KEY_URI |
protected static String |
KEY_VALIDATED |
Constructor and Description |
---|
GenericChallenge() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
acceptable(String type)
Checks if the type is acceptable to this challenge.
|
protected <T> T |
get(String key)
Gets a value from the challenge state.
|
URI |
getLocation()
Returns the location
URI of the challenge. |
Status |
getStatus()
Returns the current status of the challenge.
|
String |
getType()
Returns the challenge type by name (e.g.
|
Date |
getValidated()
Returns the validation date, if returned by the server.
|
static byte[] |
jwkThumbprint(PublicKey key)
Computes a JWK Thumbprint.
|
void |
respond(ClaimBuilder cb)
Exports the response state, as preparation for triggering the challenge.
|
void |
unmarshall(Map<String,Object> map)
Sets the challenge state by reading the given JSON map.
|
protected static final String KEY_TYPE
protected static final String KEY_STATUS
protected static final String KEY_URI
protected static final String KEY_VALIDATED
public String getType()
Challenge
public Status getStatus()
Challenge
public URI getLocation()
Challenge
URI
of the challenge.getLocation
in interface Challenge
public Date getValidated()
Challenge
getValidated
in interface Challenge
public void unmarshall(Map<String,Object> map)
Challenge
unmarshall
in interface Challenge
map
- JSON map containing the challenge datapublic void respond(ClaimBuilder cb)
Challenge
respond
in interface Challenge
cb
- ClaimBuilder
to copy the response toprotected boolean acceptable(String type)
type
- Type to checktrue
if acceptable, false
if notprotected <T> T get(String key)
key
- Keynull
if not setiizi® is a registered trademark of Mindus SARL. © Copyright 2019 Mindus SARL. All rights reserved.