core_crypto/mls/credential/
error.rs

1//! MLS credential errors
2
3// We allow missing documentation in the error module because the types are generally self-descriptive.
4#![allow(missing_docs)]
5
6pub(crate) type Result<T, E = Error> = core::result::Result<T, E>;
7
8#[derive(Debug, thiserror::Error)]
9pub enum Error {
10    #[error("The certificate chain is invalid or not complete")]
11    InvalidCertificateChain,
12    #[error("decoding X509 certificate")]
13    DecodeX509(#[source] x509_cert::der::Error),
14    #[error("client presented an invalid identity")]
15    InvalidIdentity,
16    /// Unsupported credential type.
17    ///
18    /// Supported credential types:
19    ///
20    /// - basic
21    /// - x509
22    #[error("unsupported credential type")]
23    UnsupportedCredentialType,
24    /// This operation is not supported.
25    ///
26    /// There are some operations which must be implemented to satisfy a trait,
27    /// but for which we cannot offer a real implementation. Those raise this error.
28    ///
29    /// Where possible, a short workaround is included.
30    #[error("unsupported operation. prefer `{0}`")]
31    UnsupportedOperation(&'static str),
32    #[error("unsupported algorithm")]
33    UnsupportedAlgorithm,
34    #[error(transparent)]
35    Keystore(#[from] crate::KeystoreError),
36    #[error(transparent)]
37    Mls(#[from] crate::MlsError),
38    #[error(transparent)]
39    Recursive(#[from] crate::RecursiveError),
40}