java.lang.Object
org.shredzone.acme4j.AccountBuilder
A builder for registering a new account.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddContact
(String contact) Add a contact address to the list of contacts.addContact
(URI contact) Add a contact URI to the list of contacts.Add a email address to the list of contacts.Signals that the user agrees to the terms of service.Creates a new account.createLogin
(Session session) Creates a new account.Signals that only an existing account should be returned.useKeyPair
(KeyPair keyPair) Sets theKeyPair
to be used for this account.withKeyIdentifier
(String kid, String encodedMacKey) Sets a Key Identifier and MAC key provided by the CA.withKeyIdentifier
(String kid, SecretKey macKey) Sets a Key Identifier and MAC key provided by the CA.
-
Constructor Details
-
AccountBuilder
public AccountBuilder()
-
-
Method Details
-
addContact
Add a contact URI to the list of contacts.- Parameters:
contact
- Contact URI- Returns:
- itself
-
addContact
Add a contact address to the list of contacts.This is a convenience call for
addContact(URI)
.- Parameters:
contact
- Contact URI as string- Returns:
- itself
- Throws:
IllegalArgumentException
- if there is a syntax error in the URI string
-
addEmail
Add a email address to the list of contacts.This is a convenience call for
addContact(String)
that doesn't require from you attach "mailto" scheme before email address.- Parameters:
email
- Contact email without "mailto" scheme (e.g. test@gmail.com)- Returns:
- itself
- Throws:
IllegalArgumentException
- if there is a syntax error in the URI string
-
agreeToTermsOfService
Signals that the user agrees to the terms of service.- Returns:
- itself
-
onlyExisting
Signals that only an existing account should be returned. The server will not create a new account if the key is not known. This is useful if you only have your account's key pair available, but not your account's location URL.- Returns:
- itself
-
useKeyPair
Sets theKeyPair
to be used for this account.- Parameters:
keyPair
- Account'sKeyPair
- Returns:
- itself
-
withKeyIdentifier
Sets a Key Identifier and MAC key provided by the CA. Use this if your CA requires an individual account identification, e.g. your customer number.- Parameters:
kid
- Key IdentifiermacKey
- MAC key- Returns:
- itself
-
withKeyIdentifier
Sets a Key Identifier and MAC key provided by the CA. Use this if your CA requires an individual account identification, e.g. your customer number.- Parameters:
kid
- Key IdentifierencodedMacKey
- Base64url encoded MAC key. It will be decoded for your convenience.- Returns:
- itself
-
create
Creates a new account.- Parameters:
session
-Session
to be used for registration- Returns:
Account
referring to the new account- Throws:
AcmeException
-
createLogin
- Parameters:
session
-Session
to be used for registration- Returns:
Login
referring to the new account- Throws:
AcmeException
-