#[non_exhaustive]pub enum MultikeyError {
Show 13 variants
InvalidMultibase,
DecodedTooShort(usize),
UnknownCodecPrefix,
NonPublicKeyMaterial,
EmptyKey,
InvalidCompressedPoint,
UnknownCodecName {
reason: CodecNameReason,
},
KeyLengthMismatch {
codec: MultikeyCodecKind,
expected: usize,
actual: usize,
},
KeyTooLarge {
codec: MultikeyCodecKind,
max: usize,
actual: usize,
},
EncodedPayloadTooLarge,
BindingTypeCodecMismatch {
binding_type: BindingTypeKind,
codec: MultikeyCodecKind,
algorithm: BindingAlgorithmKind,
},
BindingAlgorithmMismatch {
binding_alg: BindingAlgorithmKind,
codec_algorithm: BindingAlgorithmKind,
},
BindingAlgorithmMissing {
binding_type: BindingTypeKind,
},
}Expand description
Error returned when parsing, encoding, or validating a multikey fails.
Parsing fails closed: malformed input yields one of these variants.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidMultibase
The input is not a valid multibase string.
DecodedTooShort(usize)
The decoded bytes are too short to hold a codec prefix and key.
UnknownCodecPrefix
The multicodec prefix is not a recognized key type.
NonPublicKeyMaterial
The prefix identifies private or symmetric key material.
EmptyKey
A variable-length public-key payload was empty.
InvalidCompressedPoint
A compressed EC point did not start with a compressed SEC1 tag.
UnknownCodecName
The given codec name is not one of the supported names.
Fields
reason: CodecNameReasonWhich class of unknown codec name was supplied.
KeyLengthMismatch
The key length does not match the length required by the codec.
Fields
codec: MultikeyCodecKindCanonical codec name whose length requirement was violated.
KeyTooLarge
A variable-length key exceeded this crate’s semantic safety limit.
Fields
codec: MultikeyCodecKindCanonical codec name whose length limit was violated.
EncodedPayloadTooLarge
The final multikey payload exceeded the base58btc safety limit.
BindingTypeCodecMismatch
The binding type is incompatible with the key’s multicodec.
Fields
binding_type: BindingTypeKindDeclared binding type.
codec: MultikeyCodecKindCanonical codec name implied by the key.
algorithm: BindingAlgorithmKindAlgorithm string implied by the codec.
BindingAlgorithmMismatch
The declared binding algorithm disagrees with the codec’s algorithm.
Fields
binding_alg: BindingAlgorithmKindAlgorithm declared in the binding.
codec_algorithm: BindingAlgorithmKindAlgorithm string implied by the codec.
BindingAlgorithmMissing
A required explicit algorithm was omitted for this binding type.
Fields
binding_type: BindingTypeKindBinding type that requires an explicit algorithm.
Trait Implementations§
Source§impl Debug for MultikeyError
impl Debug for MultikeyError
Source§impl Display for MultikeyError
impl Display for MultikeyError
Source§impl Error for MultikeyError
impl Error for MultikeyError
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()