hsmtool/util/attribute/
error.rs

1// Copyright lowRISC contributors (OpenTitan project).
2// Licensed under the Apache License, Version 2.0, see LICENSE for details.
3// SPDX-License-Identifier: Apache-2.0
4
5use super::AttributeType;
6use cryptoki::object::Attribute;
7use thiserror::Error;
8
9#[derive(Debug, Error)]
10pub enum AttributeError {
11    #[error("Invalid data type")]
12    InvalidDataType,
13    #[error("Encoding error")]
14    EncodingError,
15    #[error("Unknown attribute: {0:?}")]
16    UnknownAttribute(Attribute),
17    #[error("Unknown attribute type: {0:?}")]
18    UnknownAttributeType(AttributeType),
19    #[error("Attribute not found: {0:?}")]
20    AttributeNotFound(AttributeType),
21}