Struct instant_acme::Account

source ·
pub struct Account { /* private fields */ }
Expand description

An ACME account as described in RFC 8555 (section 7.1.2)

Create an Account with Account::create() or restore it from serialized data by passing deserialized AccountCredentials to Account::from_credentials().

The Account type is cheap to clone.

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

Implementations§

source§

impl Account

source

pub async fn from_credentials( credentials: AccountCredentials ) -> Result<Self, Error>

Restore an existing account from the given credentials

The AccountCredentials type is opaque, but supports deserialization.

source

pub async fn from_credentials_and_http( credentials: AccountCredentials, http: Box<dyn HttpClient> ) -> Result<Self, Error>

Restore an existing account from the given credentials and HTTP client

The AccountCredentials type is opaque, but supports deserialization.

source

pub async fn from_parts( id: String, key_pkcs8_der: &[u8], directory_url: &str, http: Box<dyn HttpClient> ) -> Result<Self, Error>

Restore an existing account from the given ID, private key, server URL and HTTP client

The key must be provided in DER-encoded PKCS#8. This is usually how ECDSA keys are encoded in PEM files. Use a crate like rustls-pemfile to decode from PEM to DER.

source

pub async fn create( account: &NewAccount<'_>, server_url: &str, external_account: Option<&ExternalAccountKey> ) -> Result<(Account, AccountCredentials), Error>

Create a new account on the server_url with the information in NewAccount

The returned AccountCredentials can be serialized and stored for later use. Use Account::from_credentials() to restore the account from the credentials.

source

pub async fn create_with_http( account: &NewAccount<'_>, server_url: &str, external_account: Option<&ExternalAccountKey>, http: Box<dyn HttpClient> ) -> Result<(Account, AccountCredentials), Error>

Create a new account with a custom HTTP client

The returned AccountCredentials can be serialized and stored for later use. Use Account::from_credentials() to restore the account from the credentials.

source

pub async fn new_order<'a>( &'a self, order: &NewOrder<'_> ) -> Result<Order, Error>

Create a new order based on the given NewOrder

Returns an Order instance. Use the Order::state() method to inspect its state.

source

pub async fn revoke<'a>( &'a self, payload: &RevocationRequest<'a> ) -> Result<(), Error>

Revokes a previously issued certificate

Trait Implementations§

source§

impl Clone for Account

source§

fn clone(&self) -> Account

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. 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<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.

§

impl<T> Instrument for T

§

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

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

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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