Class AcmeAccount.Builder
- java.lang.Object
-
- org.wildfly.security.x500.cert.acme.AcmeAccount.Builder
-
- Enclosing class:
- AcmeAccount
public static class AcmeAccount.Builder extends Object
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static String
ACCOUNT_KEY_NAME
private String
algHeader
private X509Certificate
certificate
private String[]
contactUrls
static int
DEFAULT_ACCOUNT_EC_KEY_SIZE
The default account key size that will be used if the key algorithm name is EC.static String
DEFAULT_ACCOUNT_KEY_ALGORITHM_NAME
The default account key algorithm name.static int
DEFAULT_ACCOUNT_KEY_SIZE
The default account key size that will be used if the key algorithm name is not EC.private X500Principal
dn
private String
keyAlgorithmName
private int
keySize
private PrivateKey
privateKey
private String
serverUrl
private String
signatureAlgorithm
private String
stagingServerUrl
private boolean
termsOfServiceAgreed
-
Constructor Summary
Constructors Constructor Description Builder()
Construct a new uninitialized instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AcmeAccount
build()
Create an ACME account.AcmeAccount.Builder
setContactUrls(String[] contactUrls)
Set the contact URLs.AcmeAccount.Builder
setDn(X500Principal dn)
Set the DN to use when generating the account key pair.AcmeAccount.Builder
setKey(X509Certificate certificate, PrivateKey privateKey)
Set the account key pair.AcmeAccount.Builder
setKeyAlgorithmName(String keyAlgorithmName)
Set the key algorithm name to use when generating the account key pair.AcmeAccount.Builder
setKeySize(int keySize)
Set the key size to use when generating the account key pair.AcmeAccount.Builder
setServerUrl(String serverUrl)
Set the URL of the ACME server endpoint.AcmeAccount.Builder
setStagingServerUrl(String stagingServerUrl)
Set the URL of the ACME staging server endpoint.AcmeAccount.Builder
setTermsOfServiceAgreed(boolean termsOfServiceAgreed)
Set if the terms of service of the ACME server have been agreed to.
-
-
-
Field Detail
-
DEFAULT_ACCOUNT_KEY_ALGORITHM_NAME
public static final String DEFAULT_ACCOUNT_KEY_ALGORITHM_NAME
The default account key algorithm name.- See Also:
- Constant Field Values
-
DEFAULT_ACCOUNT_KEY_SIZE
public static final int DEFAULT_ACCOUNT_KEY_SIZE
The default account key size that will be used if the key algorithm name is not EC.- See Also:
- Constant Field Values
-
DEFAULT_ACCOUNT_EC_KEY_SIZE
public static final int DEFAULT_ACCOUNT_EC_KEY_SIZE
The default account key size that will be used if the key algorithm name is EC.- See Also:
- Constant Field Values
-
ACCOUNT_KEY_NAME
static final String ACCOUNT_KEY_NAME
- See Also:
- Constant Field Values
-
contactUrls
private String[] contactUrls
-
termsOfServiceAgreed
private boolean termsOfServiceAgreed
-
serverUrl
private String serverUrl
-
stagingServerUrl
private String stagingServerUrl
-
privateKey
private PrivateKey privateKey
-
certificate
private X509Certificate certificate
-
dn
private X500Principal dn
-
keyAlgorithmName
private String keyAlgorithmName
-
keySize
private int keySize
-
algHeader
private String algHeader
-
signatureAlgorithm
private String signatureAlgorithm
-
-
Method Detail
-
setContactUrls
public AcmeAccount.Builder setContactUrls(String[] contactUrls)
Set the contact URLs.- Parameters:
contactUrls
- the contact URLs (must not benull
)- Returns:
- this builder instance
-
setTermsOfServiceAgreed
public AcmeAccount.Builder setTermsOfServiceAgreed(boolean termsOfServiceAgreed)
Set if the terms of service of the ACME server have been agreed to.- Parameters:
termsOfServiceAgreed
- whether or not the ACME server's terms of service have been agreed to- Returns:
- this builder instance
-
setServerUrl
public AcmeAccount.Builder setServerUrl(String serverUrl)
Set the URL of the ACME server endpoint.- Parameters:
serverUrl
- the ACME server endpoint URL (must not benull
)- Returns:
- this builder instance
-
setStagingServerUrl
public AcmeAccount.Builder setStagingServerUrl(String stagingServerUrl)
Set the URL of the ACME staging server endpoint.- Parameters:
stagingServerUrl
- the ACME staging server endpoint URL (must not benull
)- Returns:
- this builder instance
-
setKeyAlgorithmName
public AcmeAccount.Builder setKeyAlgorithmName(String keyAlgorithmName)
Set the key algorithm name to use when generating the account key pair.- Parameters:
keyAlgorithmName
- the key algorithm name to use when generating the account key pair (must not benull
)- Returns:
- this builder instance
-
setKeySize
public AcmeAccount.Builder setKeySize(int keySize)
Set the key size to use when generating the account key pair.- Parameters:
keySize
- the key size to use when generating the account key pair- Returns:
- this builder instance
-
setDn
public AcmeAccount.Builder setDn(X500Principal dn)
Set the DN to use when generating the account key pair.- Parameters:
dn
- the DN to use as both the subject DN and the issuer DN (must not benull
)- Returns:
- this builder instance
-
setKey
public AcmeAccount.Builder setKey(X509Certificate certificate, PrivateKey privateKey)
Set the account key pair.- Parameters:
certificate
- the certificate (must not benull
)privateKey
- the key (must not benull
)- Returns:
- this builder instance
-
build
public AcmeAccount build() throws IllegalArgumentException
Create an ACME account.- Returns:
- the newly created ACME account
- Throws:
IllegalArgumentException
- if a required builder parameter is missing or invalid
-
-