pub enum CoreError {
Show 13 variants
InvalidPassword,
InvalidPasswordFormat(String),
Locked,
AlgorithmMismatch {
expected: String,
actual: String,
},
UnsupportedAlgorithm(String),
MalformedDocument(String),
MalformedKey(String),
MalformedEnvelope(String),
SignatureInvalid(String),
EncryptionFailed(String),
DecryptionFailed(String),
SchemaInvalid(String),
AgreementFailed(String),
}Expand description
Protocol-layer error.
One variant per failure mode. Variant names are stable wire identifiers
(they appear as the code field of the serialized error); do not rename
without bumping the JACS WASM contract.
Variants§
InvalidPassword
The supplied password does not unlock the encrypted private key.
InvalidPasswordFormat(String)
The supplied password is structurally invalid (e.g. empty).
Locked
The agent has been locked via clear_secrets; sign operations are
rejected until re-unlocked. Verification still works.
AlgorithmMismatch
The caller asked for one algorithm but the loaded material is a different one.
Fields
UnsupportedAlgorithm(String)
The algorithm identifier or envelope magic is unknown / reserved.
MalformedDocument(String)
The JACS document is structurally invalid (missing field, wrong type, malformed canonical bytes, …).
MalformedKey(String)
A key blob is malformed (wrong length, bad PKCS#8 structure, …).
MalformedEnvelope(String)
The encrypted-key envelope is structurally invalid (short, bad
JSON, missing field, …). Distinct from InvalidPassword.
SignatureInvalid(String)
The cryptographic signature did not verify against the supplied public key + payload.
EncryptionFailed(String)
AEAD encryption failed.
DecryptionFailed(String)
AEAD decryption failed (tag mismatch, KDF error, …). Distinct from
InvalidPassword, which is the specific case where the password
itself was wrong.
SchemaInvalid(String)
JSON schema validation failed.
AgreementFailed(String)
Multi-party agreement quorum / payload check failed.
Implementations§
Trait Implementations§
impl Eq for CoreError
Source§impl Error for CoreError
impl Error for CoreError
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()