Struct tor_netdoc::doc::authcert::AuthCertBuilder
source · pub struct AuthCertBuilder { /* private fields */ }
build_docs
only.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§
source§impl 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.