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.
Implementations§
Source§impl Account
impl Account
Sourcepub fn from_credentials(credentials: AccountCredentials) -> Result<Self, Error>
pub fn from_credentials(credentials: AccountCredentials) -> Result<Self, Error>
Restore an existing account from the given credentials and HTTP client
The AccountCredentials type is opaque, but supports deserialization.
Sourcepub fn from_parts(
id: String,
key_pkcs8_der: &[u8],
directory_url: &str,
) -> Result<Self, Error>
pub fn from_parts( id: String, key_pkcs8_der: &[u8], directory_url: &str, ) -> 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.
Sourcepub fn create(
account: &NewAccount<'_>,
server_url: &str,
external_account: Option<&ExternalAccountKey>,
) -> Result<(Account, AccountCredentials), Error>
pub fn create( account: &NewAccount<'_>, server_url: &str, external_account: Option<&ExternalAccountKey>, ) -> 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.