pub struct Ed25519CertConstructor {
pub(crate) exp_hours: Option<u32>,
pub(crate) cert_type: Option<CertType>,
pub(crate) cert_key: Option<CertifiedKey>,
pub(crate) extensions: Option<Vec<CertExt>>,
pub(crate) signed_with: Option<Option<Ed25519Identity>>,
}
Expand description
Builder for Ed25519Cert
.
Fields§
§exp_hours: Option<u32>
How many hours after the epoch will this certificate expire?
cert_type: Option<CertType>
Type of the certificate; recognized values are in certtype::*
cert_key: Option<CertifiedKey>
The key or object being certified.
extensions: Option<Vec<CertExt>>
A list of extensions.
signed_with: Option<Option<Ed25519Identity>>
The key that signed this cert.
Once the cert has been unwrapped from an KeyUnknownCert, this field will
be set. If there is a SignedWithEd25519
extension in
self.extensions
, this will match it.
Implementations§
Source§impl Ed25519CertConstructor
impl Ed25519CertConstructor
Sourcepub fn expiration(&mut self, expiration: SystemTime) -> &mut Self
Available on crate feature encode
only.
pub fn expiration(&mut self, expiration: SystemTime) -> &mut Self
encode
only.Set the approximate expiration time for this certificate.
(The time will be rounded forward to the nearest hour after the epoch.)
Sourcepub fn signing_key(&mut self, key: Ed25519Identity) -> &mut Self
Available on crate feature encode
only.
pub fn signing_key(&mut self, key: Ed25519Identity) -> &mut Self
encode
only.Set the signing key to be included with this certificate.
This is optional: you don’t need to include the signing key at all. If you do, it must match the key that you actually use to sign the certificate.
Sourcepub fn clear_signing_key(&mut self) -> &mut Self
Available on crate feature encode
only.
pub fn clear_signing_key(&mut self) -> &mut Self
encode
only.Remove any signing key previously set on this Ed25519CertConstructor.
Sourcepub fn encode_and_sign<S>(
&self,
skey: &S,
) -> Result<EncodedEd25519Cert, CertEncodeError>where
S: Ed25519PublicKey + Ed25519SigningKey,
Available on crate feature encode
only.
pub fn encode_and_sign<S>(
&self,
skey: &S,
) -> Result<EncodedEd25519Cert, CertEncodeError>where
S: Ed25519PublicKey + Ed25519SigningKey,
encode
only.Encode a certificate into a new vector, signing the result
with skey
.
This function exists in lieu of a build()
function, since we have a rule that
we don’t produce an Ed25519Cert
except if the certificate is known to be
valid.
Source§impl Ed25519CertConstructor
impl Ed25519CertConstructor
Sourcepub fn cert_type(&mut self, value: CertType) -> &mut Self
pub fn cert_type(&mut self, value: CertType) -> &mut Self
Type of the certificate; recognized values are in certtype::*
Sourcepub fn cert_key(&mut self, value: CertifiedKey) -> &mut Self
pub fn cert_key(&mut self, value: CertifiedKey) -> &mut Self
The key or object being certified.
Sourcepub(crate) fn create_empty() -> Self
pub(crate) fn create_empty() -> Self
Create an empty builder, with all fields set to None
or PhantomData
.
Trait Implementations§
Source§impl Clone for Ed25519CertConstructor
impl Clone for Ed25519CertConstructor
Source§fn clone(&self) -> Ed25519CertConstructor
fn clone(&self) -> Ed25519CertConstructor
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for Ed25519CertConstructor
impl RefUnwindSafe for Ed25519CertConstructor
impl Send for Ed25519CertConstructor
impl Sync for Ed25519CertConstructor
impl Unpin for Ed25519CertConstructor
impl UnwindSafe for Ed25519CertConstructor
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more