- java.lang.Object
-
- org.shredzone.acme4j.OrderBuilder
-
public class OrderBuilder extends Object
Start a new certificateOrder
.Use
Login.newOrder()
orAccount.newOrder()
to create a newOrderBuilder
instance. Both methods are identical.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
OrderBuilder(Login login)
Create a newOrderBuilder
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OrderBuilder
autoRenewal()
Enables short-term automatic renewal of the certificate, if supported by the CA.OrderBuilder
autoRenewalEnableGet()
Announces that the client wishes to fetch the auto-renewed certificate via GET request.OrderBuilder
autoRenewalEnd(Instant end)
Sets the latest date of validity of the last issued certificate.OrderBuilder
autoRenewalLifetime(Duration duration)
Sets the maximum validity period of each certificate.OrderBuilder
autoRenewalLifetimeAdjust(Duration duration)
Sets the amount of pre-dating each certificate.OrderBuilder
autoRenewalStart(Instant start)
Sets the earliest date of validity of the first issued certificate.Order
create()
Sends a new order to the server, and returns anOrder
object.OrderBuilder
domain(String domain)
Adds a domain name to the order.OrderBuilder
domains(String... domains)
Adds domain names to the order.OrderBuilder
domains(Collection<String> domains)
Adds a collection of domain names to the order.OrderBuilder
identifier(Identifier identifier)
Adds anIdentifier
to the order.OrderBuilder
identifiers(Collection<Identifier> identifiers)
Adds a collection ofIdentifier
to the order.OrderBuilder
notAfter(Instant notAfter)
Sets a "not after" date in the certificate.OrderBuilder
notBefore(Instant notBefore)
Sets a "not before" date in the certificate.OrderBuilder
replaces(String uniqueId)
Notifies the CA that the ordered certificate will replace a previously issued certificate.OrderBuilder
replaces(X509Certificate certificate)
Notifies the CA that the ordered certificate will replace a previously issued certificate.OrderBuilder
replaces(Certificate certificate)
Notifies the CA that the ordered certificate will replace a previously issued certificate.
-
-
-
Constructor Detail
-
OrderBuilder
protected OrderBuilder(Login login)
Create a newOrderBuilder
.- Parameters:
login
-Login
to bind with
-
-
Method Detail
-
domain
public OrderBuilder domain(String domain)
Adds a domain name to the order.- Parameters:
domain
- Name of a domain to be ordered. May be a wildcard domain if supported by the CA. IDN names are accepted and will be ACE encoded automatically.- Returns:
- itself
-
domains
public OrderBuilder domains(String... domains)
Adds domain names to the order.- Parameters:
domains
- Collection of domain names to be ordered. May be wildcard domains if supported by the CA. IDN names are accepted and will be ACE encoded automatically.- Returns:
- itself
-
domains
public OrderBuilder domains(Collection<String> domains)
Adds a collection of domain names to the order.- Parameters:
domains
- Collection of domain names to be ordered. May be wildcard domains if supported by the CA. IDN names are accepted and will be ACE encoded automatically.- Returns:
- itself
-
identifier
public OrderBuilder identifier(Identifier identifier)
Adds anIdentifier
to the order.- Parameters:
identifier
-Identifier
to be added to the order.- Returns:
- itself
- Since:
- 2.3
-
identifiers
public OrderBuilder identifiers(Collection<Identifier> identifiers)
Adds a collection ofIdentifier
to the order.- Parameters:
identifiers
- Collection ofIdentifier
to be added to the order.- Returns:
- itself
- Since:
- 2.3
-
notBefore
public OrderBuilder notBefore(Instant notBefore)
Sets a "not before" date in the certificate. May be ignored by the CA.- Parameters:
notBefore
- "not before" date- Returns:
- itself
-
notAfter
public OrderBuilder notAfter(Instant notAfter)
Sets a "not after" date in the certificate. May be ignored by the CA.- Parameters:
notAfter
- "not after" date- Returns:
- itself
-
autoRenewal
public OrderBuilder autoRenewal()
Enables short-term automatic renewal of the certificate, if supported by the CA.Automatic renewals cannot be combined with
notBefore(Instant)
ornotAfter(Instant)
.- Returns:
- itself
- Since:
- 2.3
-
replaces
public OrderBuilder replaces(String uniqueId)
Notifies the CA that the ordered certificate will replace a previously issued certificate. The certificate is identified by its ARI unique identifier.Optional, only supported if the CA provides renewal information. However, in this case the client should include this field.
- Parameters:
uniqueId
- Certificate's renewal unique identifier.- Returns:
- itself
- 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.
-
replaces
public OrderBuilder replaces(X509Certificate certificate)
Notifies the CA that the ordered certificate will replace a previously issued certificate.Optional, only supported if the CA provides renewal information. However, in this case the client should include this field.
- Parameters:
certificate
- Certificate to be replaced- Returns:
- itself
- 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.
-
replaces
public OrderBuilder replaces(Certificate certificate)
Notifies the CA that the ordered certificate will replace a previously issued certificate.Optional, only supported if the CA provides renewal information. However, in this case the client should include this field.
- Parameters:
certificate
- Certificate to be replaced- Returns:
- itself
- 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.
-
autoRenewalStart
public OrderBuilder autoRenewalStart(Instant start)
Sets the earliest date of validity of the first issued certificate. If not set, the start date is the earliest possible date.Implies
autoRenewal()
.- Parameters:
start
- Start date of validity- Returns:
- itself
- Since:
- 2.3
-
autoRenewalEnd
public OrderBuilder autoRenewalEnd(Instant end)
Sets the latest date of validity of the last issued certificate. If not set, the CA's default is used.Implies
autoRenewal()
.- Parameters:
end
- End date of validity- Returns:
- itself
- Since:
- 2.3
- See Also:
Metadata.getAutoRenewalMaxDuration()
-
autoRenewalLifetime
public OrderBuilder autoRenewalLifetime(Duration duration)
Sets the maximum validity period of each certificate. If not set, the CA's default is used.Implies
autoRenewal()
.- Parameters:
duration
- Duration of validity of each certificate- Returns:
- itself
- Since:
- 2.3
- See Also:
Metadata.getAutoRenewalMinLifetime()
-
autoRenewalLifetimeAdjust
public OrderBuilder autoRenewalLifetimeAdjust(Duration duration)
Sets the amount of pre-dating each certificate. If not set, the CA's default (0) is used.Implies
autoRenewal()
.- Parameters:
duration
- Duration of certificate pre-dating- Returns:
- itself
- Since:
- 2.7
-
autoRenewalEnableGet
public OrderBuilder autoRenewalEnableGet()
Announces that the client wishes to fetch the auto-renewed certificate via GET request. If not used, the STAR certificate can only be fetched via POST-as-GET request.Metadata.isAutoRenewalGetAllowed()
must returntrue
in order for this option to work.This option is only needed if you plan to fetch the STAR certificate via other means than by using acme4j. acme4j is fetching certificates via POST-as-GET request.
Implies
autoRenewal()
.- Returns:
- itself
- Since:
- 2.6
-
create
public Order create() throws AcmeException
Sends a new order to the server, and returns anOrder
object.- Returns:
Order
that was created- Throws:
AcmeException
-
-