Struct acme2::AccountBuilder
source · [−]pub struct AccountBuilder { /* private fields */ }
Expand description
An builder that is used to create / retrieve an Account
from the
ACME server.
Implementations
sourceimpl AccountBuilder
impl AccountBuilder
sourcepub fn new(directory: Arc<Directory>) -> Self
pub fn new(directory: Arc<Directory>) -> Self
This creates a new AccountBuilder
. This can be used to create a new
account (if the server has not seen the private key before), or to retrieve
an existing account (using a previously used private key).
sourcepub fn private_key(&mut self, private_key: PKey<Private>) -> &mut Self
pub fn private_key(&mut self, private_key: PKey<Private>) -> &mut Self
The private key that is used to sign requests to the ACME server. This may not be the same as a certificate private key.
sourcepub fn contact(&mut self, contact: Vec<String>) -> &mut Self
pub fn contact(&mut self, contact: Vec<String>) -> &mut Self
The contact information for the account. For example this could be a
vec!["email:hello@lcas.dev".to_string()]
. The supported contact types
vary from one ACME server to another.
sourcepub fn terms_of_service_agreed(
&mut self,
terms_of_service_agreed: bool
) -> &mut Self
pub fn terms_of_service_agreed(
&mut self,
terms_of_service_agreed: bool
) -> &mut Self
If you agree to the ACME server terms of service.
sourcepub fn only_return_existing(&mut self, only_return_existing: bool) -> &mut Self
pub fn only_return_existing(&mut self, only_return_existing: bool) -> &mut Self
Do not try to create a new account. If this is set, only an existing account will be returned.
sourcepub async fn build(&mut self) -> Result<Arc<Account>, Error>
pub async fn build(&mut self) -> Result<Arc<Account>, Error>
This will create / retrieve an Account
from the ACME server.
If the AccountBuilder
does not contain a private key, a new
4096 bit RSA key will be generated (using the system random). If
a key is generated, it can be retrieved from the created Account
through the Account::private_key
method.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for AccountBuilder
impl Send for AccountBuilder
impl Sync for AccountBuilder
impl Unpin for AccountBuilder
impl !UnwindSafe for AccountBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more