pub enum DidKeyError {
NotDidKey(String),
InvalidMultibase(String),
UnknownCodec(u64),
InvalidKeyLength {
codec: &'static str,
expected: usize,
actual: usize,
},
MalformedJwt(String),
InvalidHeader(String),
InvalidClaims(String),
BadSignature(String),
KeyParse(String),
Json(Error),
Base64(DecodeError),
}Expand description
Errors surfaced by every public API in this crate.
Variants§
NotDidKey(String)
Input was not a did:key:z… string.
InvalidMultibase(String)
Multibase header or body rejected (only base58btc ‘z’ accepted).
UnknownCodec(u64)
Multicodec varint prefix did not match any supported algorithm.
InvalidKeyLength
Key bytes were the wrong length for the declared codec.
MalformedJwt(String)
JWT compact serialisation is malformed (segment count / base64).
InvalidHeader(String)
JWT header rejected — wrong alg, missing key binding, alg
does not match the bound did:key, etc.
InvalidClaims(String)
JWT claims rejected — htm/htu/iat mismatch.
BadSignature(String)
Cryptographic signature verification failed.
KeyParse(String)
Failure parsing an underlying elliptic-curve key or signature.
Json(Error)
Serde / JSON decode failures.
Base64(DecodeError)
Base64 decode failures.
Trait Implementations§
Source§impl Debug for DidKeyError
impl Debug for DidKeyError
Source§impl Display for DidKeyError
impl Display for DidKeyError
Source§impl Error for DidKeyError
impl Error for DidKeyError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<DecodeError> for DidKeyError
impl From<DecodeError> for DidKeyError
Source§fn from(source: DecodeError) -> Self
fn from(source: DecodeError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for DidKeyError
impl !RefUnwindSafe for DidKeyError
impl Send for DidKeyError
impl Sync for DidKeyError
impl Unpin for DidKeyError
impl UnsafeUnpin for DidKeyError
impl !UnwindSafe for DidKeyError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more