Skip to main content

systemprompt_config/bootstrap/
key_material.rs

1//! Decoding failures of the encoded key material held in the secrets file.
2//!
3//! Copyright (c) systemprompt.io — Business Source License 1.1.
4//! See <https://systemprompt.io> for licensing details.
5
6#[derive(Debug, thiserror::Error)]
7pub enum KeyMaterialError {
8    #[error("base64 decode failed: {0}")]
9    Base64(#[from] base64::DecodeError),
10
11    #[error("hex decode failed: {0}")]
12    Hex(#[from] hex::FromHexError),
13
14    #[error("utf-8 decode failed: {0}")]
15    Utf8(#[from] std::string::FromUtf8Error),
16
17    #[error("expected {expected}-byte value, got {actual}")]
18    Length { expected: usize, actual: usize },
19}