#[non_exhaustive]pub enum DataIntegrityError {
UnsupportedCryptoSuite {
name: String,
},
KeyTypeMismatch {
expected: KeyType,
actual: KeyType,
suite: CryptoSuite,
},
InvalidSignature {
suite: CryptoSuite,
reason: SignatureFailure,
},
InvalidPublicKey {
codec: Option<u64>,
len: usize,
reason: String,
},
Canonicalization(String),
MalformedProof(String),
Conformance(String),
Signing(Box<dyn Error + Send + Sync>),
Resolver(String),
}Expand description
Errors raised by data-integrity signing and verification.
This type is #[non_exhaustive]: callers must include a wildcard arm
when matching, so future additions do not constitute breaking changes.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UnsupportedCryptoSuite
The cryptosuite identifier is not recognised by this build, either because the name is unknown or because the matching Cargo feature is disabled.
KeyTypeMismatch
The signer’s key type is not compatible with the requested cryptosuite.
InvalidSignature
The signature could not be verified.
InvalidPublicKey
A public key has an unexpected multicodec, length, or encoding.
Canonicalization(String)
Canonicalization (JCS / RDFC / other) of the document or proof config failed.
MalformedProof(String)
The proof document is structurally invalid (missing required fields,
wrong type, malformed created timestamp, mismatched @context,
etc.).
Conformance(String)
A conformance check against the Data Integrity spec failed for a
reason other than the signature itself (e.g. missing proofPurpose,
wrong type, created in the future).
Signing(Box<dyn Error + Send + Sync>)
A signer (local or remote) returned an error while producing a signature.
Resolver(String)
A verification-method resolver (did:key, did:web, etc.) failed to locate or decode the requested key.
Implementations§
Trait Implementations§
Source§impl Debug for DataIntegrityError
impl Debug for DataIntegrityError
Source§impl Display for DataIntegrityError
impl Display for DataIntegrityError
Source§impl Error for DataIntegrityError
impl Error for DataIntegrityError
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()