openmls::ciphersuite::signable

Trait Signable

Source
pub trait Signable: Sized {
    type SignedOutput;

    // Required methods
    fn unsigned_payload(&self) -> Result<Vec<u8>, Error>;
    fn label(&self) -> &str;

    // Provided method
    fn sign(
        self,
        signer: &impl Signer,
    ) -> Result<Self::SignedOutput, SignatureError>
       where Self::SignedOutput: SignedStruct<Self> { ... }
}
Expand description

The Signable trait is implemented by all struct that are being signed. The implementation has to provide the unsigned_payload function.

Required Associated Types§

Source

type SignedOutput

The type of the object once it’s signed.

Required Methods§

Source

fn unsigned_payload(&self) -> Result<Vec<u8>, Error>

Return the unsigned, serialized payload that should be signed.

Source

fn label(&self) -> &str

Return the string label used for labeled signing.

Provided Methods§

Source

fn sign( self, signer: &impl Signer, ) -> Result<Self::SignedOutput, SignatureError>
where Self::SignedOutput: SignedStruct<Self>,

Sign the payload with the given private_key.

Returns a Signature.

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.

Implementors§