- java.lang.Object
-
- org.shredzone.acme4j.AcmeResource
-
- org.shredzone.acme4j.AcmeJsonResource
-
- org.shredzone.acme4j.Authorization
-
- All Implemented Interfaces:
Serializable
public class Authorization extends AcmeJsonResource
Represents an authorization request at the ACME server.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Authorization(Login login, URL location)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deactivate()
Permanently deactivates theAuthorization
.<T extends Challenge>
Optional<T>findChallenge(Class<T> type)
Finds aChallenge
of the given class type.<T extends Challenge>
Optional<T>findChallenge(String type)
Finds aChallenge
of the given type.List<Challenge>
getChallenges()
Gets a list of all challenges offered by the server, in no specific order.Optional<Instant>
getExpires()
Gets the expiry date of the authorization, if set by the server.Identifier
getIdentifier()
Gets theIdentifier
to be authorized.Status
getStatus()
Gets the authorization status.boolean
isSubdomainAuthAllowed()
Returnstrue
if certificates for subdomains can be issued according to RFC9444.boolean
isWildcard()
-
Methods inherited from class org.shredzone.acme4j.AcmeJsonResource
fetch, getJSON, getRetryAfter, invalidate, isValid, setJSON, setRetryAfter, update
-
Methods inherited from class org.shredzone.acme4j.AcmeResource
finalize, getLocation, getLogin, getSession, rebind
-
-
-
-
Constructor Detail
-
Authorization
protected Authorization(Login login, URL location)
-
-
Method Detail
-
getIdentifier
public Identifier getIdentifier()
Gets theIdentifier
to be authorized.For wildcard domain orders, the domain itself (without wildcard prefix) is returned here. To find out if this
Authorization
is related to a wildcard domain order, check theisWildcard()
method.- Since:
- 2.3
-
getStatus
public Status getStatus()
Gets the authorization status.Possible values are:
Status.PENDING
,Status.VALID
,Status.INVALID
,Status.DEACTIVATED
,Status.EXPIRED
,Status.REVOKED
.
-
getExpires
public Optional<Instant> getExpires()
Gets the expiry date of the authorization, if set by the server.
-
isWildcard
public boolean isWildcard()
-
isSubdomainAuthAllowed
public boolean isSubdomainAuthAllowed()
Returnstrue
if certificates for subdomains can be issued according to RFC9444.- Since:
- 3.3.0
-
getChallenges
public List<Challenge> getChallenges()
Gets a list of all challenges offered by the server, in no specific order.
-
findChallenge
public <T extends Challenge> Optional<T> findChallenge(String type)
Finds aChallenge
of the given type. Responding to thisChallenge
is sufficient for authorization.findChallenge(Class)
should be preferred, as this variant is not type safe.- Parameters:
type
- Challenge name (e.g. "http-01")- Returns:
Challenge
matching that name, or empty if there is no such challenge, or if the challenge alone is not sufficient for authorization.- Throws:
ClassCastException
- if the type does not match the expected Challenge class type
-
findChallenge
public <T extends Challenge> Optional<T> findChallenge(Class<T> type)
Finds aChallenge
of the given class type. Responding to thisChallenge
is sufficient for authorization.- Parameters:
type
- Challenge type (e.g. "Http01Challenge.class")- Returns:
Challenge
of that type, or empty if there is no such challenge, or if the challenge alone is not sufficient for authorization.- Since:
- 2.8
-
deactivate
public void deactivate() throws AcmeException
Permanently deactivates theAuthorization
.- Throws:
AcmeException
-
-