openmls/key_packages/
errors.rsuse thiserror::Error;
use crate::{ciphersuite::signable::SignatureError, error::LibraryError};
#[derive(Error, Debug, PartialEq, Clone)]
pub enum KeyPackageVerifyError {
#[error(transparent)]
LibraryError(#[from] LibraryError),
#[error("The lifetime of the leaf node is not valid.")]
InvalidLifetime,
#[error("The lifetime of the leaf node is missing.")]
MissingLifetime,
#[error("A key package extension is not supported in the leaf's capabilities.")]
UnsupportedExtension,
#[error("The key package signature is not valid.")]
InvalidSignature,
#[error("The leaf node signature is not valid.")]
InvalidLeafNodeSignature,
#[error("Invalid LeafNode source type")]
InvalidLeafNodeSourceType,
#[error("The init key and the encryption key are equal.")]
InitKeyEqualsEncryptionKey,
#[error("The protocol version is not valid.")]
InvalidProtocolVersion,
}
#[derive(Error, Debug, PartialEq, Eq, Clone)]
pub enum KeyPackageExtensionSupportError {
#[error("The key package does not support all required extensions.")]
UnsupportedExtension,
}
#[derive(Error, Debug, PartialEq, Clone)]
pub enum KeyPackageNewError {
#[error(transparent)]
LibraryError(#[from] LibraryError),
#[error("The ciphersuite does not match the signature scheme.")]
CiphersuiteSignatureSchemeMismatch,
#[error("Accessing storage failed.")]
StorageError,
#[error(transparent)]
SignatureError(#[from] SignatureError),
}