Struct tor_netdoc::doc::authcert::AuthCertBuilder
source · [−]pub struct AuthCertBuilder { /* private fields */ }
Expand description
A builder object used to construct an authority certificate.
Create one of these with the AuthCert::builder
method.
This facility is only enabled when the crate is built with
the build_docs
feature.
Implementations
sourceimpl AuthCertBuilder
impl AuthCertBuilder
sourcepub fn address(&mut self, address: SocketAddrV4) -> &mut Self
pub fn address(&mut self, address: SocketAddrV4) -> &mut Self
Set the IPv4 address for this authority.
This field is optional.
sourcepub fn identity_key(&mut self, key: PublicKey) -> &mut Self
pub fn identity_key(&mut self, key: PublicKey) -> &mut Self
Set the identity key for this authority.
This field is required.
sourcepub fn signing_key(&mut self, key: PublicKey) -> &mut Self
pub fn signing_key(&mut self, key: PublicKey) -> &mut Self
Set the identity key for this certificate.
This field is required.
sourcepub fn lifespan(&mut self, lifespan: Range<SystemTime>) -> &mut Self
pub fn lifespan(&mut self, lifespan: Range<SystemTime>) -> &mut Self
Set the lifespan for this certificate.
These fields are required.
sourcepub fn dangerous_testing_cert(&self) -> BuildResult<AuthCert>
pub fn dangerous_testing_cert(&self) -> BuildResult<AuthCert>
Try to construct an AuthCert
from this builder.
This function can fail if any of the builder’s fields are missing or ill-formed.
Danger
This function is dangerous because it can be used to construct a certificate where no certificate actually exists: The identity key here has not, in fact, attested to the signing key.
You should only use this function for testing.
Auto Trait Implementations
impl RefUnwindSafe for AuthCertBuilder
impl Send for AuthCertBuilder
impl Sync for AuthCertBuilder
impl Unpin for AuthCertBuilder
impl UnwindSafe for AuthCertBuilder
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