Struct instant_acme::Order
source · pub struct Order { /* private fields */ }
Expand description
An ACME order as described in RFC 8555 (section 7.1.3)
An order is created from an Account
by calling Account::new_order()
. The Order
type represents the stable identity of an order, while the Order::state()
method
gives you access to the current state of the order according to the server.
Implementations
sourceimpl Order
impl Order
Retrieve the authorizations for this order
An order will contain one authorization to complete per identifier in the order. After creating an order, you’ll need to retrieve the authorizations so that you can set up a challenge response for each authorization.
For each authorization, you’ll need to:
- Select which
ChallengeType
you want to complete - Create a
KeyAuthorization
for thatChallenge
- Call
Order::set_challenge_ready()
for that challenge
After the challenges have been set up, check the Order::state()
to see
if the order is ready to be finalized (or becomes invalid). Once it is
ready, call Order::finalize()
to get the certificate.
Create a KeyAuthorization
for the given Challenge
Signs the challenge’s token with the account’s private key and use the
value from KeyAuthorization::as_str()
as the challenge response.
sourcepub async fn finalize(
&mut self,
csr_der: &[u8],
finalize_url: &str
) -> Result<String, Error>
pub async fn finalize(
&mut self,
csr_der: &[u8],
finalize_url: &str
) -> Result<String, Error>
Request a certificate from the given Certificate Signing Request (CSR)
Creating a CSR is outside of the scope of instant-acme. Make sure you pass in a
DER representation of the CSR in csr_der
and the OrderState::finalize
URL
in finalize_url
. The resulting String
will contain the PEM-encoded certificate chain.
sourcepub async fn set_challenge_ready(
&mut self,
challenge_url: &str
) -> Result<(), Error>
pub async fn set_challenge_ready(
&mut self,
challenge_url: &str
) -> Result<(), Error>
Notify the server that the given challenge is ready to be completed
challenge_url
should be the Challenge::url
field.
sourcepub async fn challenge(
&mut self,
challenge_url: &str
) -> Result<Challenge, Error>
pub async fn challenge(
&mut self,
challenge_url: &str
) -> Result<Challenge, Error>
Get the current state of the given challenge
sourcepub async fn state(&mut self) -> Result<OrderState, Error>
pub async fn state(&mut self) -> Result<OrderState, Error>
Get the current state of the order