pub trait ToEncodableCert<K: ToEncodableKey>: Clone {
type Cert: EncodableItem + 'static;
type SigningKey: ToEncodableKey;
// Required methods
fn validate(
&self,
subject: &K,
signed_with: &Self::SigningKey,
) -> StdResult<(), InvalidCertError>;
fn to_encodable_cert(self) -> Self::Cert;
fn from_encodable_cert(cert: Self::Cert) -> Self
where Self: Sized;
}Expand description
A trait representing an encodable certificate.
K represents the (Rust) type of the subject key.
Required Associated Types§
Sourcetype Cert: EncodableItem + 'static
type Cert: EncodableItem + 'static
The low-level type this can be converted to/from.
Sourcetype SigningKey: ToEncodableKey
type SigningKey: ToEncodableKey
The (Rust) type of the signing key.
Required Methods§
Sourcefn validate(
&self,
subject: &K,
signed_with: &Self::SigningKey,
) -> StdResult<(), InvalidCertError>
fn validate( &self, subject: &K, signed_with: &Self::SigningKey, ) -> StdResult<(), InvalidCertError>
Validate this certificate. This function should return an error if
- the certificate is not timely (i.e. it is expired, or not yet valid), or
- the certificate is not well-signed, or
- the subject key or signing key in the certificate do not match
the subject and signing keys specified in
cert_spec
Sourcefn to_encodable_cert(self) -> Self::Cert
fn to_encodable_cert(self) -> Self::Cert
Convert this cert to a type that implements EncodableItem.
Sourcefn from_encodable_cert(cert: Self::Cert) -> Selfwhere
Self: Sized,
fn from_encodable_cert(cert: Self::Cert) -> Selfwhere
Self: Sized,
Convert an EncodableItem to another cert type.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.