openmls/key_packages/
errors.rs1use thiserror::Error;
6
7use crate::{ciphersuite::signable::SignatureError, error::LibraryError};
8
9#[derive(Error, Debug, PartialEq, Clone)]
11pub enum KeyPackageVerifyError {
12 #[error(transparent)]
14 LibraryError(#[from] LibraryError),
15 #[error("The lifetime of the leaf node is not valid.")]
17 InvalidLifetime,
18 #[error("The lifetime of the leaf node is missing.")]
20 MissingLifetime,
21 #[error("A key package extension is not supported in the leaf's capabilities.")]
23 UnsupportedExtension,
24 #[error("The key package signature is not valid.")]
26 InvalidSignature,
27 #[error("The leaf node signature is not valid.")]
29 InvalidLeafNodeSignature,
30 #[error("Invalid LeafNode source type")]
32 InvalidLeafNodeSourceType,
33 #[error("The init key and the encryption key are equal.")]
35 InitKeyEqualsEncryptionKey,
36 #[error("The protocol version is not valid.")]
38 InvalidProtocolVersion,
39}
40
41#[derive(Error, Debug, PartialEq, Eq, Clone)]
43pub enum KeyPackageExtensionSupportError {
44 #[error("The key package does not support all required extensions.")]
46 UnsupportedExtension,
47}
48
49#[derive(Error, Debug, PartialEq, Clone)]
51pub enum KeyPackageNewError {
52 #[error(transparent)]
54 LibraryError(#[from] LibraryError),
55 #[error("The ciphersuite does not match the signature scheme.")]
57 CiphersuiteSignatureSchemeMismatch,
58 #[error("Accessing storage failed.")]
60 StorageError,
61 #[error(transparent)]
63 SignatureError(#[from] SignatureError),
64}