Struct Account

Source
pub struct Account { /* private fields */ }
Expand description

An Acout at an ACME provider. Used to query certificates and challanges

  1. load_or_create your Account
  2. place a new_order for your domains
  3. check_auth for a single domain, if valid move to 6.
  4. use tls_alpn_01 to get a certificate for it
  5. trigger_challenge on that domain
  6. repeat 3. - 5. for all other domains
  7. send_csr for your cert …
  8. … and finally obtain_certificate

Implementations§

Source§

impl Account

Source

pub async fn load_or_create<'a, C, S, I>( directory: Directory, cache: Option<&C>, contact: I, ) -> Result<Self, AcmeError>
where C: AcmeCache, S: AsRef<str> + 'a, I: IntoIterator<Item = &'a S>,

Create or load a cached Account for ACME provider at directory. Provide your email in contact in the form mailto:admin@example.com to receive warnings regarding your certificate. Set a cache to remember/load your account.

Source

pub async fn new_order(&self, domains: Vec<String>) -> Result<Order, AcmeError>

send a new order for the DNS identifiers in domains

Source

pub async fn check_auth(&self, url: impl AsRef<str>) -> Result<Auth, AcmeError>

check the authentication status for a particular challange

Source

pub async fn trigger_challenge( &self, url: impl AsRef<str>, ) -> Result<(), AcmeError>

trigger a particular challange

Source

pub async fn send_csr( &self, url: impl AsRef<str>, csr: Vec<u8>, ) -> Result<Order, AcmeError>

request a certificate to be signed

Source

pub async fn obtain_certificate( &self, url: impl AsRef<str>, ) -> Result<String, AcmeError>

obtain a signed certificate for a privious CSR

Source

pub fn tls_alpn_01<'a>( &self, challenges: &'a [Challenge], ) -> Result<(&'a Challenge, impl AsRef<[u8]>), AcmeError>

return a hash for first alpn challange. the hash needs to be presented inside the TLS certificate when the ACME TLS ALPN is present

Trait Implementations§

Source§

impl Debug for Account

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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