Struct 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.

https://datatracker.ietf.org/doc/html/rfc8555#section-7.1.3

Implementations§

Source§

impl Order

Source

pub fn authorizations(&mut self) -> Authorizations<'_>

Retrieve the authorizations for this order

An order contains 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.

This method will retrieve the authorizations attached to this order if they have not been retrieved yet. If you have already consumed the stream generated by this method before, processing it again will not involve any network activity.

Source

pub async fn finalize(&mut self) -> Result<String, Error>

Available on crate feature rcgen only.

Generate a Certificate Signing Request for the order’s identifiers and request finalization

Uses the rcgen crate to generate a Certificate Signing Request (CSR) converting the order’s identifiers to Subject Alternative Names, then calls Order::finalize_csr() with it. Returns the generated private key, serialized as PEM.

After this succeeds, call Order::certificate() to retrieve the certificate chain once the order is in the appropriate state.

Source

pub async fn finalize_csr(&mut self, csr_der: &[u8]) -> Result<(), Error>

Request a certificate from the given Certificate Signing Request (CSR)

csr_der contains the CSR representation serialized in DER encoding. If you don’t need custom certificate parameters, Order::finalize() can generate the CSR for you.

After this succeeds, call Order::certificate() to retrieve the certificate chain once the order is in the appropriate state.

Source

pub async fn certificate(&mut self) -> Result<Option<String>, Error>

Get the certificate for this order

If the cached order state is in ready or processing state, this will poll the server for the latest state. If the order is still in processing state after that, this will return Ok(None). If the order is in valid state, this will attempt to retrieve the certificate from the server and return it as a String. If the order contains an error or ends up in any state other than valid or processing, return an error.

Source

pub fn identifiers(&mut self) -> Identifiers<'_>

Retrieve the identifiers for this order

This method will retrieve the identifiers attached to the authorizations for this order if they have not been retrieved yet. If you have already consumed the stream generated by Order::authorizations(), this will not involve any network activity.

Source

pub async fn poll_ready( &mut self, retries: &RetryPolicy, ) -> Result<OrderStatus, Error>

Poll the order with the given RetryPolicy

Yields the OrderStatus immediately if Ready or Invalid, or yields an Error::Timeout if the RetryPolicy::timeout has been reached.

Source

pub async fn poll_certificate( &mut self, retries: &RetryPolicy, ) -> Result<String, Error>

Poll the certificate with the given RetryPolicy

Yields the PEM encoded certificate chain for this order if the order state becomes Valid. The function keeps polling as long as the order state is Processing. An error is returned immediately: if the order state is Invalid, if polling runs into a timeout, or if the ACME CA suggest to retry at a later time.

Source

pub async fn refresh(&mut self) -> Result<&OrderState, Error>

Refresh the current state of the order

Source

pub fn into_parts(self) -> (String, OrderState)

Extract the URL and last known state from the Order

Source

pub fn state(&mut self) -> &OrderState

Get the last known state of the order

Call refresh() to get the latest state from the server.

Source

pub fn url(&self) -> &str

Get the URL of the order

Auto Trait Implementations§

§

impl Freeze for Order

§

impl !RefUnwindSafe for Order

§

impl Send for Order

§

impl Sync for Order

§

impl Unpin for Order

§

impl !UnwindSafe for Order

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more