logo
#[non_exhaustive]
pub enum Error {
Show 161 variants InvalidSubject, InvalidCriticalHeader, UnknownCriticalHeader, InvalidIssuer, NotImplemented, AlgorithmNotImplemented, ProofTypeNotImplemented, MissingAlgorithm, MissingCurve, MissingPoint, MissingKeyValue, MissingIdentifier, MissingChosenIssuer, ExpectedTerm, ExpectedNQuad, ExpectedLiteral, ExpectedBlankNodeLabel, ExpectedIRIRef, ExpectedLang, AlgorithmMismatch, KeyIdVMMismatch(StringString), ObjectMismatch(StringStringString), ExpectedObjectForPredicate(StringString), UnexpectedObjectForPredicate(StringString), MissingType, MissingStatement, UnexpectedEndOfList, ListItemMismatch(StringString), ExpectedEndOfList, ExpectedRestOfList, ExpectedListValue, UnexpectedTriple(Triple), KeyMismatch, VerificationMethodMismatch, UnsupportedAlgorithm, UnsupportedCurve, UnsupportedMultipleVMs, KeyTypeNotImplemented, UnsupportedNonDIDIssuer(String), CurveNotImplemented(String), MissingKey, MissingPrivateKey, MissingModulus, MissingExponent, MissingPrime, MissingCredential, MissingPresentation, MissingKeyParameters, MissingProof, MissingIssuanceDate, MissingTypeVerifiableCredential, MissingTypeVerifiablePresentation, MissingIssuer, MissingAccountId, MissingVerificationMethod, MissingVerificationRelationship(StringProofPurposeString), Key, Secp256k1Parse(String), Secp256r1Parse(String), MultipleKeyMaterial, TimeError, URI, DIDURL, DIDURLDereference(String), UnexpectedDIDFragment, InvalidContext, ControllerLimit, MissingContext, MissingDocumentId, MissingProofSignature, ExpiredProof, FutureProof, InvalidProofPurpose, MissingProofPurpose, InvalidProofDomain, InvalidSignature, UnexpectedSignatureLength(usizeusize), InvalidJWS, MissingJWSHeader, MissingCredentialSchema, UnsupportedProperty, UnsupportedKeyType, UnsupportedType, UnsupportedProofPurpose, UnsupportedCheck, UnsupportedBlankPredicate, JWTCredentialInPresentation, UnencodableOptionClaim(String), ExpectedUnencodedHeader, ResourceNotFound(String), InvalidProofTypeType, InvalidKeyLength, InconsistentDIDKey, RingError, ExpectedObject, ExpectedArray, ExpectedString, ExpectedStringPublicKeyMultibase, MultibaseKeyLength(usizeusize), MultibaseKeyPrefix, ExpectedList, ExpectedArrayList, ExpectedValue, MissingGraph, MissingActiveProperty, MissingActivePropertyEntry, ConflictingIndexes, ValueObjectLanguageType, UnexpectedKeyword, UnexpectedIRI, ExpectedValueTypeJson, UnrecognizedDirection, ExpectedStringIndex, UnexpectedNestedArray, UnexpectedValue, UnexpectedList, UnexpectedSet, RepresentationNotSupported, ExpectedLangStringType, IRIRefNotWellFormed, SerializeDouble, ExpectedFailure, ExpectedMultibaseZ, EncodeTezosSignedMessage(EncodeTezosSignedMessageError), DecodeTezosSignature(DecodeTezosSignatureError), ExpectedOutput(StringString), UnknownProcessingMode(String), UnknownRdfDirection(String), KeyRejected(KeyRejectedError), FromUtf8(FromUtf8Error), Secp256k1(Secp256k1Error), Secp256r1(Secp256r1Error), ASN1Encode(ASN1EncodeError), Base64(Base64Error), Multibase(MultibaseError), JSON(JSONError), SerdeJSON(SerdeJSONError), SerdeUrlEncoded(SerdeUrlEncodedError), JSONLD(JSONLDErrorCode), IRI(IRIError), ParseInt(ParseIntError), CharTryFrom(CharTryFromError), TryFromSlice(TryFromSliceError), UnexpectedCAIP2Namepace(StringString), UnexpectedAleoNetwork(StringString), BlockchainAccountIdParse(BlockchainAccountIdParseError), BlockchainAccountIdVerify(BlockchainAccountIdVerifyError), FromHex(FromHexError), Base58(Error), HexString, ExpectedLowercase, SignaturePrefix, KeyPrefix, UnableToResolve(String), P256KeyLength(usize), ECEncodingError, ECDecompress, K256EC(Error), P256EC(Error), MissingFeatures(&'static str), NumericDateOutOfMicrosecondPrecisionRange,
}
Expand description

Error type for ssi.

Variants (Non-exhaustive)

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.

InvalidSubject

Invalid subject for JWT VC

InvalidCriticalHeader

Invalid crit property in JWT header

UnknownCriticalHeader

Unknown crit header name in JWT header

InvalidIssuer

Invalid issuer for JWT

NotImplemented

Functionality not implemented

AlgorithmNotImplemented

JWA algorithm not implemented

ProofTypeNotImplemented

Linked Data Proof type not implemented

MissingAlgorithm

Missing algorithm in JWT

MissingCurve

Missing curve in JWK

MissingPoint

Missing elliptic curve point in JWK

MissingKeyValue

Missing key value for symmetric key

MissingIdentifier

Missing identifier

MissingChosenIssuer

Missing chosen issuer

ExpectedTerm

Expected RDF term

ExpectedNQuad

Expected RDF N-Quad

ExpectedLiteral

Expected RDF Literal

ExpectedBlankNodeLabel

Expected RDF blank node label

ExpectedIRIRef

Expected RDF IRI reference

ExpectedLang

Expected RDF language tag

AlgorithmMismatch

Algorithm in JWS header does not match JWK

KeyIdVMMismatch(StringString)

Verification method id does not match JWK id

ObjectMismatch(StringStringString)

RDF statement object does not match value

ExpectedObjectForPredicate(StringString)

Missing RDF statement object

UnexpectedObjectForPredicate(StringString)

Unexpected RDF statement object

MissingType

Missing type

MissingStatement

Missing RDF statement

UnexpectedEndOfList

Unexpected end of list

ListItemMismatch(StringString)

List item mismatch

ExpectedEndOfList

Expected end of list

ExpectedRestOfList

Expected rest of list

ExpectedListValue

Expected list value

UnexpectedTriple(Triple)

Unexpected triple

KeyMismatch

Key mismatch

VerificationMethodMismatch

Verification method mismatch

UnsupportedAlgorithm

Unsupported algorithm

UnsupportedCurve

Unsupported curve

UnsupportedMultipleVMs

Unsupported multiple verification methods

KeyTypeNotImplemented

Key type not implemented

UnsupportedNonDIDIssuer(String)

Unsupported non-DID issuer

CurveNotImplemented(String)

Curve not implemented

MissingKey

JWT key not found

MissingPrivateKey

Missing private key parametern JWK

MissingModulus

Missing modulus in RSA key

MissingExponent

Missing exponent in RSA key

MissingPrime

Missing prime factor in RSA key

MissingCredential

Verifiable credential not found in JWT

MissingPresentation

Verifiable presentation not found in JWT

MissingKeyParameters

JWT key parameters not found

MissingProof

Missing proof property

MissingIssuanceDate

Missing issuance date

MissingTypeVerifiableCredential

Missing type VerifiableCredential

MissingTypeVerifiablePresentation

Missing type VerifiablePresentation

MissingIssuer

Missing issuer property

MissingAccountId

Missing account id

MissingVerificationMethod

Missing verificationMethod

MissingVerificationRelationship(StringProofPurposeString)

Missing verification relationship

Key

Problem with JWT key

Secp256k1Parse(String)

Problem parsing Secp256k1 key

Secp256r1Parse(String)

Problem parsing Secp256r1 key

MultipleKeyMaterial

A verification method MUST NOT contain multiple verification material properties for the same material. (DID Core)

TimeError

Unable to convert date/time

URI

Invalid URI

DIDURL

Invalid DID URL

DIDURLDereference(String)

Unable to dereference DID URL

UnexpectedDIDFragment

Unexpected DID fragment

InvalidContext

Invalid context

ControllerLimit

DID controller limit exceeded

MissingContext

Missing context

MissingDocumentId

Missing document ID

MissingProofSignature

Missing JWS in proof

ExpiredProof

Expired proof

FutureProof

Proof creation time is in the future

InvalidProofPurpose

Invalid proof domain

MissingProofPurpose

Missing proof purpose

InvalidProofDomain

Invalid proof domain

InvalidSignature

Invalid Signature (in proof)

UnexpectedSignatureLength(usizeusize)

Signature length did not match expected length.

InvalidJWS

Invalid JWS

MissingJWSHeader

Missing JWS Header

MissingCredentialSchema

Missing credential schema for ZKP

UnsupportedProperty

Unsupported property for linked data proof

UnsupportedKeyType

Unsupported key type

UnsupportedType

Unsupported type for linked data proof

UnsupportedProofPurpose

Unsupported proof purpose

UnsupportedCheck

Unsupported check

UnsupportedBlankPredicate

Blank node identifier in predicate is unsupported

JWTCredentialInPresentation

Unsupported JWT VC in VP

UnencodableOptionClaim(String)

Linked data proof option unencodable as JWT claim

ExpectedUnencodedHeader

Expected unencoded JWT header

ResourceNotFound(String)

Resource not found

InvalidProofTypeType

Invalid ProofType type

InvalidKeyLength

Invalid key length

InconsistentDIDKey

Inconsistent DID Key

RingError

Crypto error from ring crate

ExpectedObject

Expected object

ExpectedArray

Expected array

ExpectedString

Expected string

ExpectedStringPublicKeyMultibase

Expected string for publicKeyMultibase

MultibaseKeyLength(usizeusize)

Unexpected length for publicKeyMultibase

MultibaseKeyPrefix

Unexpected multibase (multicodec) key prefix multicodec

ExpectedList

Expected object with @list key

ExpectedArrayList

Expected array in @list

ExpectedValue

Expected object with @value key

MissingGraph

Missing graph

MissingActiveProperty

Missing active property

MissingActivePropertyEntry

Missing active property entry

ConflictingIndexes

ValueObjectLanguageType

Value object with @type must not contain @language or @direction

UnexpectedKeyword

Unexpected keyword in object

UnexpectedIRI

Unexpected IRI in object

ExpectedValueTypeJson

Value object expected @json @type for array or object value

UnrecognizedDirection

Unrecognized @direction value

ExpectedStringIndex

Expected string value for @index key of value object

UnexpectedNestedArray

Unexpected nested array

UnexpectedValue

Unexpected @value key

UnexpectedList

Unexpected @list key

UnexpectedSet

Unexpected @set key

RepresentationNotSupported

representationNotSupported DID resolution error

ExpectedLangStringType

Expected rdf:langString type with language-tagged string literal

IRIRefNotWellFormed

IRI reference not well-formed

SerializeDouble

Unable to serialize double

ExpectedFailure

Expected failure

ExpectedMultibaseZ

Expected multibase Z prefix (base58)

EncodeTezosSignedMessage(EncodeTezosSignedMessageError)

Unable to encode Signed Tezos Message

DecodeTezosSignature(DecodeTezosSignatureError)

Unable to decode Tezos Signature

ExpectedOutput(StringString)

Output did not match expected value.

UnknownProcessingMode(String)

Unknown JSON-LD processing mode

UnknownRdfDirection(String)

Unknown RDF direction

KeyRejected(KeyRejectedError)

This is supported on crate feature ring only.

Error parsing a key with ring

FromUtf8(FromUtf8Error)

Error parsing a UTF-8 string

Secp256k1(Secp256k1Error)

This is supported on crate feature k256 only.

Error from k256 crate

Secp256r1(Secp256r1Error)

This is supported on crate feature p256 only.

Error from p256 crate

ASN1Encode(ASN1EncodeError)

Error encoding ASN.1 data structure.

Base64(Base64Error)

Error decoding Base64

Multibase(MultibaseError)

Error parsing or producing multibase

JSON(JSONError)

Error from json crate

SerdeJSON(SerdeJSONError)

Error from serde_json crate

SerdeUrlEncoded(SerdeUrlEncodedError)

Error from serde_urlencoded crate

JSONLD(JSONLDErrorCode)

Error from json-ld crate

IRI(IRIError)

Error from iref crate

ParseInt(ParseIntError)

Error parsing integer

CharTryFrom(CharTryFromError)

Error parsing a char

TryFromSlice(TryFromSliceError)

Error converting slice to array

UnexpectedCAIP2Namepace(StringString)

Unexpected CAIP-2 namespace

UnexpectedAleoNetwork(StringString)

Unexpected Aleo namespace

BlockchainAccountIdParse(BlockchainAccountIdParseError)

Error parsing CAIP-10 blockchain account id

BlockchainAccountIdVerify(BlockchainAccountIdVerifyError)

Error verifying CAIP-10 blockchain account id against a public key

FromHex(FromHexError)

Error decoding hex data

Base58(Error)

Error decoding Base58 data

HexString

Expected string beginning with ‘0x’

ExpectedLowercase

Expected string to contain only lowercase

SignaturePrefix

Unknown signature prefix

KeyPrefix

Unknown key prefix

UnableToResolve(String)

Unable to resolve DID

P256KeyLength(usize)

Expected 64 byte uncompressed key or 33 bytes compressed key

ECEncodingError

Unable to encode elliptic curve key

ECDecompress

Unable to decompress elliptic curve

K256EC(Error)

This is supported on crate feature k256 only.

Error from k256 crate

P256EC(Error)

This is supported on crate feature p256 only.

Error from p256 crate

MissingFeatures(&'static str)

Missing crate features

NumericDateOutOfMicrosecondPrecisionRange

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Wrap an Error in a Dereferencing Metadata atructure.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Converts a reference to Self into a dynamic trait object of Fail.

convert self with kind and static string into an error

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Converts self into T using Into<T>. Read more

Converts self into a target type. Read more

Returns the “name” of the error. Read more

Returns a reference to the underlying cause of this failure, if it is an error that wraps other errors. Read more

Returns a reference to the Backtrace carried by this failure, if it carries one. Read more

Provides context for this failure. Read more

Wraps this failure in a compatibility wrapper that implements std::error::Error. Read more

Causes self to use its Binary implementation when Debug-formatted.

Causes self to use its Display implementation when Debug-formatted. Read more

Causes self to use its LowerExp implementation when Debug-formatted. Read more

Causes self to use its LowerHex implementation when Debug-formatted. Read more

Causes self to use its Octal implementation when Debug-formatted.

Causes self to use its Pointer implementation when Debug-formatted. Read more

Causes self to use its UpperExp implementation when Debug-formatted. Read more

Causes self to use its UpperHex implementation when Debug-formatted. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Pipes by value. This is generally the method you want to use. Read more

Borrows self and passes that borrow into the pipe function. Read more

Mutably borrows self and passes that borrow into the pipe function. Read more

Borrows self, then passes self.borrow() into the pipe function. Read more

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more

Borrows self, then passes self.as_ref() into the pipe function.

Mutably borrows self, then passes self.as_mut() into the pipe function. Read more

Borrows self, then passes self.deref() into the pipe function.

Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more

Pipes a value into a function that cannot ordinarily be called in suffix position. Read more

Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more

Pipes a dereference into a function that cannot normally be called in suffix position. Read more

Pipes a mutable dereference into a function that cannot normally be called in suffix position. Read more

Pipes a reference into a function that cannot ordinarily be called in suffix position. Read more

Pipes a mutable reference into a function that cannot ordinarily be called in suffix position. Read more

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

Immutable access to a value. Read more

Mutable access to a value. Read more

Immutable access to the Borrow<B> of a value. Read more

Mutable access to the BorrowMut<B> of a value. Read more

Immutable access to the AsRef<R> view of a value. Read more

Mutable access to the AsMut<R> view of a value. Read more

Immutable access to the Deref::Target of a value. Read more

Mutable access to the Deref::Target of a value. Read more

Calls .tap() only in debug builds, and is erased in release builds.

Calls .tap_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref_mut() only in debug builds, and is erased in release builds. Read more

Provides immutable access for inspection. Read more

Calls tap in debug builds, and does nothing in release builds.

Provides mutable access for modification. Read more

Calls tap_mut in debug builds, and does nothing in release builds.

Provides immutable access to the reference for inspection.

Calls tap_ref in debug builds, and does nothing in release builds.

Provides mutable access to the reference for modification.

Calls tap_ref_mut in debug builds, and does nothing in release builds.

Provides immutable access to the borrow for inspection. Read more

Calls tap_borrow in debug builds, and does nothing in release builds.

Provides mutable access to the borrow for modification.

Calls tap_borrow_mut in debug builds, and does nothing in release builds. Read more

Immutably dereferences self for inspection.

Calls tap_deref in debug builds, and does nothing in release builds.

Mutably dereferences self for modification.

Calls tap_deref_mut in debug builds, and does nothing in release builds. Read more

Converts the given value to a String. Read more

Attempts to convert self into T using TryInto<T>. Read more

Attempts to convert self into a target type. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more