- java.lang.Object
-
- org.shredzone.acme4j.Login
-
public class Login extends Object
ALogin
into an account.A login is bound to a
Session
. However, aSession
can handle multiple logins in parallel.To create a login, you need to specify the location URI of the
Account
, and need to provide theKeyPair
the account was created with. If the account's location URL is unknown, the account can be re-registered with theAccountBuilder
, usingAccountBuilder.onlyExisting()
to make sure that no new account will be created. If the key pair was lost though, there is no automatic way to regain access to your account, and you have to contact your CA's support hotline for assistance.Note that
Login
objects are intentionally not serializable, as they contain a keypair and volatile data. On distributed systems, you can create aLogin
to the same account for every service instance.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Authorization
bindAuthorization(URL location)
Creates a new instance of an existingAuthorization
and binds it to this login.Certificate
bindCertificate(URL location)
Creates a new instance of an existingCertificate
and binds it to this login.Challenge
bindChallenge(URL location)
Creates a new instance of an existingChallenge
and binds it to this login.<C extends Challenge>
CbindChallenge(URL location, Class<C> type)
Creates a new instance of an existingChallenge
and binds it to this login.Order
bindOrder(URL location)
Creates a new instance of an existingOrder
and binds it to this login.RenewalInfo
bindRenewalInfo(URL location)
Creates a new instance of an existingRenewalInfo
and binds it to this login.RenewalInfo
bindRenewalInfo(X509Certificate certificate)
Creates a new instance of an existingRenewalInfo
and binds it to this login.Challenge
createChallenge(JSON data)
Creates aChallenge
instance for the given challenge data.Account
getAccount()
Gets theAccount
that is bound to this login.URL
getAccountLocation()
Gets the locationURL
of the account.KeyPair
getKeyPair()
Gets theKeyPair
of the ACME account.Session
getSession()
Gets theSession
that is used.OrderBuilder
newOrder()
Creates a builder for a newOrder
.protected void
setKeyPair(KeyPair keyPair)
Sets a differentKeyPair
.
-
-
-
Method Detail
-
getSession
public Session getSession()
Gets theSession
that is used.
-
getKeyPair
public KeyPair getKeyPair()
Gets theKeyPair
of the ACME account.
-
getAccountLocation
public URL getAccountLocation()
Gets the locationURL
of the account.
-
getAccount
public Account getAccount()
Gets theAccount
that is bound to this login.- Returns:
Account
bound to the login
-
bindAuthorization
public Authorization bindAuthorization(URL location)
Creates a new instance of an existingAuthorization
and binds it to this login.- Parameters:
location
- Location of the Authorization- Returns:
Authorization
bound to the login
-
bindCertificate
public Certificate bindCertificate(URL location)
Creates a new instance of an existingCertificate
and binds it to this login.- Parameters:
location
- Location of the Certificate- Returns:
Certificate
bound to the login
-
bindOrder
public Order bindOrder(URL location)
Creates a new instance of an existingOrder
and binds it to this login.- Parameters:
location
- Location URL of the order- Returns:
Order
bound to the login
-
bindRenewalInfo
public RenewalInfo bindRenewalInfo(URL location)
Creates a new instance of an existingRenewalInfo
and binds it to this login.- Parameters:
location
- Location URL of the renewal info- Returns:
RenewalInfo
bound to the login- Since:
- 3.0.0
-
bindRenewalInfo
public RenewalInfo bindRenewalInfo(X509Certificate certificate) throws AcmeException
Creates a new instance of an existingRenewalInfo
and binds it to this login.- Parameters:
certificate
-X509Certificate
to get theRenewalInfo
for- Returns:
RenewalInfo
bound to the login- Throws:
AcmeException
- Since:
- 3.2.0
- Draft:
- This method 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.
-
bindChallenge
public Challenge bindChallenge(URL location)
Creates a new instance of an existingChallenge
and binds it to this login. Use this method only if the resulting challenge type is unknown.- Parameters:
location
- Location URL of the challenge- Returns:
Challenge
bound to the login- Since:
- 2.8
- See Also:
bindChallenge(URL, Class)
-
bindChallenge
public <C extends Challenge> C bindChallenge(URL location, Class<C> type)
Creates a new instance of an existingChallenge
and binds it to this login. Use this method if the resulting challenge type is known.- Parameters:
location
- Location URL of the challengetype
- Expected challenge type- Returns:
- Challenge bound to the login
- Throws:
AcmeProtocolException
- if the challenge found at the location does not match the expected challenge type.- Since:
- 2.12
-
createChallenge
public Challenge createChallenge(JSON data)
Creates aChallenge
instance for the given challenge data.- Parameters:
data
- Challenge JSON data- Returns:
Challenge
instance
-
newOrder
public OrderBuilder newOrder()
Creates a builder for a newOrder
.- Returns:
OrderBuilder
object- Since:
- 3.0.0
-
setKeyPair
protected void setKeyPair(KeyPair keyPair)
Sets a differentKeyPair
. The new key pair is only used locally in this instance, but is not set on server side!
-
-