#[non_exhaustive]pub enum CryptoError {
SignatureInvalid,
SignatureMalformed(String),
KeyParseFailed(String),
AidNotEd25519(String),
AlgMismatch(String),
TypMismatch {
expected: String,
got: String,
},
JwsMalformed(String),
}Expand description
Errors returned by signing, verifying, and key parsing operations.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
SignatureInvalid
Signature verification returned a cryptographic failure.
SignatureMalformed(String)
Signature string was not valid base64url or wrong length.
KeyParseFailed(String)
Public key bytes could not be parsed as an Ed25519 key.
AidNotEd25519(String)
AID identifier did not decode to a valid 32-byte Ed25519 key.
AlgMismatch(String)
Compact-JWS header alg is not the sole value derived from the
signer’s AID (RFC-AITP-0001 §5.4.5). Includes none in any
capitalization and unknown algorithms. Wire code:
TOKEN_ALG_MISMATCH.
TypMismatch
Compact-JWS header typ does not exactly match the value
expected for the verification context (RFC-AITP-0001 §5.4.5).
Wire code: TOKEN_TYP_MISMATCH.
Fields
JwsMalformed(String)
Compact JWS failed strict parsing (RFC-AITP-0001 §5.4.5): wrong segment count, empty segment, non-base64url characters, padding, or a malformed protected header.
Trait Implementations§
Source§impl Debug for CryptoError
impl Debug for CryptoError
Source§impl Display for CryptoError
impl Display for CryptoError
Source§impl Error for CryptoError
impl Error for CryptoError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()