core_crypto/mls/credential/
error.rs1#![allow(missing_docs)]
5
6use core_crypto_keystore::Sha256Hash;
7use openmls::prelude::SignaturePublicKey;
8
9pub(crate) type Result<T, E = Error> = core::result::Result<T, E>;
10
11#[derive(Debug, thiserror::Error)]
12pub enum Error {
13 #[error("decoding X509 certificate")]
14 DecodeX509(#[source] x509_cert::der::Error),
15 #[error("client presented an invalid identity")]
16 InvalidIdentity,
17 #[error("No credential found for public key {0:?}")]
18 CredentialNotFound(SignaturePublicKey),
19 #[error("No credential found matching public key hash {0}")]
20 CredentialRefNotFound(Sha256Hash),
21 #[error("missing PKI environment")]
22 MissingPKIEnvironment,
23 #[error("unsupported credential type (variant {0}")]
30 UnsupportedCredentialType(u16),
31 #[error("the signature scheme {0:?} was not present in the provided x509 identity")]
32 SignatureSchemeNotPresentInX509Identity(openmls::prelude::SignatureScheme),
33 #[error("unsupported operation. prefer `{0}`")]
40 UnsupportedOperation(&'static str),
41 #[error("unsupported algorithm")]
42 UnsupportedAlgorithm,
43 #[error(transparent)]
44 UnknownCipherSuite(#[from] crate::mls::UnknownCipherSuite),
45 #[error(transparent)]
46 Keystore(#[from] crate::KeystoreError),
47 #[error(transparent)]
48 OpenMls(#[from] crate::OpenMlsError),
49 #[error(transparent)]
50 Recursive(#[from] crate::RecursiveError),
51 #[error(transparent)]
52 Tls(#[from] crate::TlsCodecError),
53}