1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
45#[derive(Debug, thiserror::Error)]
6pub enum ErrorKind {
7#[error("NSS error: {0}")]
8NSSError(#[from] nss::Error),
9#[error("Internal crypto error")]
10InternalError,
11#[error("Conversion error: {0}")]
12ConversionError(#[from] std::num::TryFromIntError),
13#[error("Root hash format error: {0}")]
14RootHashFormatError(String),
15#[error("PEM content format error: {0}")]
16PEMFormatError(String),
17#[error("Certificate content error: {0}")]
18CertificateContentError(String),
19#[error("Certificate not yet valid or expired")]
20CertificateValidityError,
21#[error("Certificate subject mismatch")]
22CertificateSubjectError,
23#[error("Certificate issuer mismatch")]
24CertificateIssuerError,
25#[error("Certificate chain of trust error: {0}")]
26CertificateChainError(String),
27#[error("Signature content error: {0}")]
28SignatureContentError(String),
29#[error("Content signature mismatch error: {0}")]
30SignatureMismatchError(String),
31}
3233error_support::define_error! {
34 ErrorKind {
35 (ConversionError, std::num::TryFromIntError),
36 (NSSError, nss::Error),
37 }
38}