Struct Order
pub struct Order<'a> { /* private fields */ }
Expand description
Wrapped Account
with order info
Implementations§
§impl<'a> Order<'a>
impl<'a> Order<'a>
pub async fn refresh(
&mut self,
ctx: Context,
) -> Result<(&Order, Option<Duration>), ClientError>
pub async fn refresh( &mut self, ctx: Context, ) -> Result<(&Order, Option<Duration>), ClientError>
Refresh Order
state, and return it (and potential retry-after delay in case we want to refresh again)
This also returns a duration which the server has requested to wait before calling this again if any
Get list of server::Authorization
s linked to this Order
Get server::Authorization
which is stored on the given url
pub async fn finish_challenge(
&self,
ctx: Context,
challenge: &mut Challenge,
) -> Result<(), ClientError>
pub async fn finish_challenge( &self, ctx: Context, challenge: &mut Challenge, ) -> Result<(), ClientError>
Finish the current challenge
This does two things behind the scene
- Notify acme server that challenge is ready and should be verified by the server (
Self::notify_challenge_ready
) - Polls the acme server until the server has verified this challenge and has updated its internal status (
Self::wait_until_challenge_finished
)
pub async fn notify_challenge_ready(
&self,
ctx: Context,
challenge: &Challenge,
) -> Result<(), ClientError>
pub async fn notify_challenge_ready( &self, ctx: Context, challenge: &Challenge, ) -> Result<(), ClientError>
Notify ACME server that the given challenge is ready
Server will now try to verify this and we should keep polling the server
with Self::wait_until_challenge_finished()
to wait for the result.
pub async fn refresh_challenge(
&self,
ctx: Context,
challenge: &mut Challenge,
) -> Result<Option<Duration>, ClientError>
pub async fn refresh_challenge( &self, ctx: Context, challenge: &mut Challenge, ) -> Result<Option<Duration>, ClientError>
Referesh the given challenge
This returns a duration which the server has requested to wait before calling this again if any
pub async fn wait_until_challenge_finished(
&self,
ctx: Context,
challenge: &mut Challenge,
) -> Result<(), ClientError>
pub async fn wait_until_challenge_finished( &self, ctx: Context, challenge: &mut Challenge, ) -> Result<(), ClientError>
Poll acme server until the challenge is finished (challenge.status == server::ChallengeStatus::Valid | server::ChallengeStatus::Invalid)
Keep polling acme server until all server::Authorization
s have finished
Note for this to work each server::Authorization
needs to have one valid challenge
pub async fn finalize<T>(
&mut self,
ctx: Context,
csr_der: T,
) -> Result<&Order, ClientError>
pub async fn finalize<T>( &mut self, ctx: Context, csr_der: T, ) -> Result<&Order, ClientError>
Finalize the order and request ACME server to generate a certifcate from the provided certificate params
Note: for this to work all server::Authorization
s need to have finished (order.status == server::OrderStatus::Ready)
pub async fn wait_until_certificate_ready(
&mut self,
ctx: Context,
) -> Result<&Order, ClientError>
pub async fn wait_until_certificate_ready( &mut self, ctx: Context, ) -> Result<&Order, ClientError>
Keep polling acme server until the certificate is ready (order.status == server::OrderStatus::Valid)
pub async fn download_certificate_no_checks(
&self,
ctx: Context,
) -> Result<String, ClientError>
pub async fn download_certificate_no_checks( &self, ctx: Context, ) -> Result<String, ClientError>
Download the certificate generated by the server
Note: for this to work the certificate needs to be ready (order.status == server::OrderStatus::Valid).
Use Self::download_certificate
instead to also wait for this correct status before downloading.
pub async fn download_certificate(
&mut self,
ctx: Context,
) -> Result<String, ClientError>
pub async fn download_certificate( &mut self, ctx: Context, ) -> Result<String, ClientError>
Wait until certificate is ready and then download it
To directly download the certificate without waiting for the correct status
use Self::download_certificate_no_checks
instead
pub async fn wait_until_status(
&mut self,
ctx: Context,
status: OrderStatus,
) -> Result<&Order, ClientError>
pub async fn wait_until_status( &mut self, ctx: Context, status: OrderStatus, ) -> Result<&Order, ClientError>
Keep polling until the order has reached the given status
Create KeyAuthorization
for the given challenge
pub fn create_tls_challenge_data(
&self,
challenge: &Challenge,
identifier: &Identifier,
) -> Result<(PrivatePkcs8KeyDer<'_>, Certificate), OpaqueError>
pub fn create_tls_challenge_data( &self, challenge: &Challenge, identifier: &Identifier, ) -> Result<(PrivatePkcs8KeyDer<'_>, Certificate), OpaqueError>
Create challenge data need for tls-alpn challenge
This function returns a private private key and certificate which a TLS backend should expose on port 443 (on the configured domain)
Auto Trait Implementations§
impl<'a> Freeze for Order<'a>
impl<'a> !RefUnwindSafe for Order<'a>
impl<'a> Send for Order<'a>
impl<'a> Sync for Order<'a>
impl<'a> Unpin for Order<'a>
impl<'a> !UnwindSafe for Order<'a>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy
that returns Action::Follow
only if self
and other
return
Action::Follow
. Read more