1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#![cfg(feature = "pem")]
use thiserror::Error;
#[derive(Error, Debug)]
pub enum PemError {
#[error(transparent)]
Io(#[from] std::io::Error),
#[error("Only secp256k1 curve is supported: {0:?}")]
UnsupportedKeyCurve(Vec<u8>),
#[cfg(feature = "pem")]
#[error("An error occurred while reading the file: {0}")]
PemError(#[from] pem::PemError),
#[error("A key was rejected by Ring: {0}")]
KeyRejected(#[from] ring::error::KeyRejected),
#[error("A key was rejected by k256: {0}")]
ErrorStack(#[from] k256::pkcs8::Error),
}