pub struct Directory<P: Persist> { /* private fields */ }
Expand description
Entry point for accessing an ACME API.
Implementations§
Source§impl<P: Persist> Directory<P>
impl<P: Persist> Directory<P>
Sourcepub fn from_url(persist: P, url: DirectoryUrl<'_>) -> Result<Directory<P>>
pub fn from_url(persist: P, url: DirectoryUrl<'_>) -> Result<Directory<P>>
Create a directory over a persistence implementation and directory url.
Sourcepub fn account(&self, contact_email: &str) -> Result<Account<P>>
pub fn account(&self, contact_email: &str) -> Result<Account<P>>
Access an account identified by a contact email.
If a persisted private key exists for the contact email, it will be read and used for further access. This way we reuse the same ACME API account.
If one doesn’t exist, it is created and the corresponding public key is uploaded to the ACME API thus creating the account.
Either way the newAccount
API endpoint is called and thereby ensures the
account is active and working.
This is the same as calling
account_with_realm(contact_email, ["mailto: <contact_email>"]
)
Sourcepub fn account_with_realm(
&self,
realm: &str,
contact: Option<Vec<String>>,
) -> Result<Account<P>>
pub fn account_with_realm( &self, realm: &str, contact: Option<Vec<String>>, ) -> Result<Account<P>>
Access an account using a lower level method. The contact is optional against the ACME API provider and there might be situations where you either don’t need it at all, or need it to be something else than an email address.
The realm
parameter is a persistence realm, i.e. a namespace in the
persistence where all values belonging to this Account will be stored.
If a persisted private key exists for the realm
, it will be read
and used for further access. This way we reuse the same ACME API account.
If one doesn’t exist, it is created and the corresponding public key is uploaded to the ACME API thus creating the account.
Either way the newAccount
API endpoint is called and thereby ensures the
account is active and working.
Sourcepub fn api_directory(&self) -> &ApiDirectory
pub fn api_directory(&self) -> &ApiDirectory
Access the underlying JSON object for debugging.