pub trait ToEncodableCert<K: ToEncodableKey>: Clone {
type ParsedCert: ItemType + 'static;
type EncodableCert: EncodableItem + 'static;
type SigningKey: ToEncodableKey;
// Required methods
fn validate(
cert: Self::ParsedCert,
subject: &K,
signed_with: &Self::SigningKey,
) -> StdResult<Self, InvalidCertError>;
fn to_encodable_cert(self) -> Self::EncodableCert;
}
Expand description
A trait representing an encodable certificate.
K
represents the (Rust) type of the subject key.
Required Associated Types§
Sourcetype ParsedCert: ItemType + 'static
type ParsedCert: ItemType + 'static
The low-level type this can be converted from.
Sourcetype EncodableCert: EncodableItem + 'static
type EncodableCert: EncodableItem + 'static
The low-level type this can be converted to.
Sourcetype SigningKey: ToEncodableKey
type SigningKey: ToEncodableKey
The (Rust) type of the signing key.
Required Methods§
Sourcefn validate(
cert: Self::ParsedCert,
subject: &K,
signed_with: &Self::SigningKey,
) -> StdResult<Self, InvalidCertError>
fn validate( cert: Self::ParsedCert, subject: &K, signed_with: &Self::SigningKey, ) -> StdResult<Self, 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::EncodableCert
fn to_encodable_cert(self) -> Self::EncodableCert
Convert this cert to a type that implements EncodableItem
.
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.