Skip to main content

ToEncodableCert

Trait ToEncodableCert 

Source
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§

Source

type ParsedCert: ItemType + 'static

The low-level type this can be converted from.

Source

type EncodableCert: EncodableItem + 'static

The low-level type this can be converted to.

Source

type SigningKey: ToEncodableKey

The (Rust) type of the signing key.

Required Methods§

Source

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
Source

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".

Implementors§