Struct acme_lib::order::NewOrder

source ·
pub struct NewOrder<P: Persist> { /* private fields */ }
Expand description

A new order created by Account::new_order.

An order is created using one or many domains (a primary CN and possible multiple alt names). All domains in the order must have authorizations (confirmed ownership) before the order can progress to submitting a CSR.

This order façade provides calls to provide such authorizations and to progress the order when ready.

The ACME API provider might “remember” for a time that you already own a domain, which means you might not need to prove the ownership every time. Use appropriate methods to first check whether you really need to handle authorizations.

Implementations§

source§

impl<P: Persist> NewOrder<P>

source

pub fn is_validated(&self) -> bool

Tell if the domains in this order have been authorized.

This doesn’t do any calls against the API. You must manually call refresh.

In ACME API terms, the order can either be ready or valid, which both would mean we have passed the authorization stage.

source

pub fn confirm_validations(&self) -> Option<CsrOrder<P>>

If the order is_validated progress it to a CsrOrder.

This doesn’t do any calls against the API. You must manually call [refresh].

source

pub fn refresh(&mut self) -> Result<()>

Refresh the order state against the ACME API.

The specification calls this a “POST-as-GET” against the order URL.

source

pub fn authorizations(&self) -> Result<Vec<Auth<P>>>

Provide the authorizations. The number of authorizations will be the same as the number of domains requests, i.e. at least one (the primary CN), but possibly more (for alt names).

If the order includes new domain names that have not been authorized before, this list might contain a mix of already valid and not yet valid auths.

source

pub fn api_order(&self) -> &ApiOrder

Access the underlying JSON object for debugging.

Auto Trait Implementations§

§

impl<P> RefUnwindSafe for NewOrder<P>
where P: RefUnwindSafe,

§

impl<P> Send for NewOrder<P>
where P: Sync,

§

impl<P> Sync for NewOrder<P>
where P: Sync,

§

impl<P> Unpin for NewOrder<P>

§

impl<P> UnwindSafe for NewOrder<P>
where P: RefUnwindSafe,

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<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, 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>,

§

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>,

§

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.