ssi library

Support for doing something awesome.

More dartdocs go here.

Classes

AddVerificationMethodResult
The result of adding a key to a DID manager.
Bip32Ed25519Wallet
A wallet implementation that supports BIP32 key derivation with Ed25519 keys.
Bip32Wallet
A wallet implementation that supports BIP32 key derivation with secp256k1 keys.
CredentialSchema
Represents a Credential Schema for verifiable credentials following W3C standards.
CredentialStatusV1
Represents a Credential Status for verifiable credentials following W3C standards.
CredentialStatusV2
Represents a Credential Status for verifiable credentials following W3C standards.
CredentialSubject
Represents a CredentialSubject for verifiable credentials following W3C standards.
DataIntegrityEcdsaJcsGenerator
Generates Data Integrity Proofs using the ecdsa-jcs-2019 cryptosuite.
DataIntegrityEcdsaJcsVerifier
Verifies Data Integrity Proofs signed with the ecdsa-jcs-2019 cryptosuite.
DataIntegrityEcdsaRdfcGenerator
Generates Data Integrity Proofs using the ecdsa-rdfc-2019 cryptosuite.
DataIntegrityEcdsaRdfcVerifier
Verifies Data Integrity Proofs signed with the ecdsa-rdfc-2019 cryptosuite.
DataIntegrityEcdsaVerifier
Verifies Data Integrity Proofs signed with the ecdsa-rdfc-2019 cryptosuite.
DataIntegrityEddsaJcsGenerator
Generates Data Integrity Proofs using the eddsa-jcs-2022 cryptosuite.
DataIntegrityEddsaJcsVerifier
Verifies Data Integrity Proofs signed with the eddsa-jcs-2022 cryptosuite.
DataIntegrityEddsaRdfcGenerator
Generates Data Integrity Proofs using the eddsa-rdfc-2022 cryptosuite.
DataIntegrityEddsaRdfcVerifier
Verifies Data Integrity Proofs signed with the eddsa-rdfc-2022 cryptosuite.
DataIntegrityRdfcEddsaVerifier
Verifies Data Integrity Proofs signed with the eddsa-rdfc-2022 cryptosuite.
DecodedType
Base type for decoded verifiable data.
DelegationVcVerifier
A verifier for checking the validity of delegations in a Verifiable Presentation (VP).
DidDocument
Represents a DID Document as defined by the W3C DID specification.
DidKey
A utility class for working with the "did:key" method.
DidKeyManager
DID Manager implementation for the did:key method.
DidKeyPair
A wrapper that combines a cryptographic key pair with its DID context.
DidManager
Base class for managing DID documents and their associated verification methods.
DidPeer
A utility class for working with the "did:peer" method.
DidPeerManager
DID Manager implementation for the did:peer method.
DidResolver
Interface for resolving DID documents.
DidSigner
A signer that uses a key pair associated with a DID document to sign data.
DidStore
A store for managing mappings between DID key identifiers and wallet key identifiers.
DidVerifier
A verifier for DID documents.
DidWeb
A utility class for working with the "did:web" method.
DidWebManager
DID Manager implementation for the did:web method.
DidWebVhDocumentMetadata
Metadata for a DID WebVH document.
DidWebVhLog
The DID Log file containing all versions of a DID.
DidWebVhLogEntry
A single entry in a DID WebVH log file.
DidWebVhLogEntryParameters
Parameters for a DID WebVH log entry that control DID processing and verification.
DidWebVhLogEntryProof
A Data Integrity proof attached to a DID WebVH log entry.
DidWebVhResolutionMetadata
Metadata associated with the resolution of a DID WebVH document.
DidWebVhResolutionOptions
Options for resolving a DID with the 'did:webvh' method.
DidWebVhUrl
Represents a DID URL for the 'webvh' method, with support for SCID and encoded URL string.
DidWebVhWitness
Represents a single witness entry from the DID:WebVH witness JSON file.
DidWebVhWitnessVerifier
Verifies DID:WebVH witness proofs per the v1.0 specification.
DocWithEmbeddedProof
Cryptographically verifiable data with embedded proof.
EcdsaSecp256k1Signature2019Proof
Data model representing a Linked Data Proof of type EcdsaSecp256k1Signature2019.
Ed25519KeyPair
A KeyPair implementation using the Ed25519 signature scheme.
EmbeddedProof
Immutable model of an embedded proof conformant to the W3C Verifiable Credential Data Integrity 1.0 specification.
EmbeddedProofGenerator
Interface used by issuance
EmbeddedProofSuiteCreateOptions
Options for creating cryptographic proofs.
EmbeddedProofSuiteVerifyOptions
Options for verifying cryptographic proofs.
EmbeddedProofVerifier
Interface used by verification
EmbeddedVerificationMethod
Represents an embedded verification method in a DID Document.
EnvelopedVcDm2Suite
Suite for working with W3C VC Data Model v2 credentials in SD-JWT format.
Evidence
Represents a Evidence for verifiable credentials following W3C standards.
Holder
Represents a Holder for verifiable credentials following W3C standards.
InMemoryDidStore
Default implementation of DidStore using an in-memory map.
InMemoryKeyStore
An in-memory implementation of the KeyStore interface.
Issuer
Represents a Issuer for verifiable credentials following W3C standards.
JcsUtil
JSON Canonicalization Scheme (JCS) implementation according to RFC 8785.
JsonLdContext
Represents an immutable JSON-LD @context.
JsonObject
Abstract class for JSON objects.
Jwk
Represents a JSON Web Key (JWK) used in DID documents.
Jws
Represents a decoded JSON Web Signature.
JwtDm1Suite
Class to parse and convert JWT token strings into a VerifiableCredential
JwtOptions
Options for configuring JWT issuance or parsing.
JwtSignResult
Result of JWT signing operation.
JwtUtil
Utility class for handling JWT operations.
JwtVcDataModelV1
Allows creating a VcDataModel from a JWT token containing an VcDataModel version 1.1 Example: https://www.w3.org/TR/vc-data-model/#example-verifiable-credential-using-jwt-compact-serialization-non-normative
KeyPair
An abstract interface for cryptographic key pairs used for signing and verifying data.
KeyStore
An interface for a key-value storage.
LdBaseSuite<VC extends DocWithEmbeddedProof, Model extends VC>
Class to parse and convert a json representation of a VerifiableCredential
LdVcDataModelV1
A VcDataModelV1 backed by a parsed JSON-LD serialized string.
LdVcDataModelV2
A VcDataModelV2 backed by a parsed JSON-LD serialized string.
LdVcDm1Suite
Class to parse and convert a json representation of a VerifiableCredential
LdVcDm2Suite
Class to parse and convert a json representation of a VerifiableCredential
LdVpDataModelV1
Implementation of LdVpDataModelV1 backed by a parsed JSON-LD string.
LdVpDataModelV2
Implementation of LdVpDataModelV2 backed by a parsed JSON-LD string.
LdVpDm1Suite
Implementation for parsing and processing JSON-LD Verifiable Presentations v1.1.
LdVpDm2Suite
Implementation for parsing and processing JSON-LD Verifiable Presentations v2.2.
MapEndpoint
Represents a service endpoint that is a map of arbitrary data.
MutableCredentialSchema
Represents a Mutable schema for verifiable credentials following W3C standards.
MutableCredentialStatusV1
Represents a Mutable Credential Status for verifiable credentials following W3C standards.
MutableCredentialStatusV2
Represents a Mutable Credential Status for verifiable credentials following W3C standards.
MutableCredentialSubject
Represents a Mutable CredentialSubject for verifiable credentials following W3C standards.
MutableEvidence
Represents a Mutable Evidence for verifiable credentials following W3C standards.
MutableHolder
Represents a Mutable Holder for verifiable credentials following W3C standards.
MutableIssuer
Represents a Mutable Issuer for verifiable credentials following W3C standards.
MutableJsonLdContext
Represents a mutable JSON-LD @context.
MutableRefreshServiceV1
Represents a Mutable refreshService for verifiable credentials following W3C standards.
MutableRefreshServiceV2
Represents a Mutable refreshService for verifiable credentials following W3C standards.
MutableTermsOfUse
Represents a Mutable termsOfUse for verifiable credentials following W3C standards.
MutableVcDataModelV1
Represents a Verifiable Credential (VC) according to the W3C VC Data Model v1.1.
MutableVcDataModelV2
Represents a Verifiable Credential (VC) according to the W3C VC Data Model v1.1.
MutableVpDataModelV1
Represents a Verifiable Presentation (VP) according to the W3C VC Data Model v1.1.
MutableVpDataModelV2
Represents a Verifiable Presentation (VP) according to the W3C VC Data Model v1.1.
P256KeyPair
A key pair implementation that uses the P-256 (secp256r1) elliptic curve for cryptographic operations.
P384KeyPair
A key pair implementation that uses the P-384 elliptic curve for cryptographic operations.
P521KeyPair
A key pair implementation that uses the P-521 elliptic curve for cryptographic operations.
ParsedVerifiableCredential<SerializedType>
A verifiable credential that maintains its serialized representation.
ParsedVerifiablePresentation<SerializedType>
An interface representing a parsed Verifiable Presentation (VP) with access to its original serialized representation.
PersistentWallet
A non-hierarchical wallet implementation that supports secp256k1, ed25519, p256, p384, and p521 key types.
PublicKey
Represents a base key with its type and public key bytes.
RefreshServiceV1
Represents a refreshService for verifiable credentials following W3C standards.
RefreshServiceV2
Represents a refreshService for verifiable credentials following W3C standards.
RevocationList2020Verifier
Verifier that checks if a Verifiable Credential is revoked using RevocationList2020Status.
SdJwtDataModelV2
A VcDataModelV2 backed by an SD-JWT credential structure.
SdJwtDidVerifier
A DID-based verifier for SD-JWT credentials.
SdJwtDm2Suite
Suite for working with W3C VC Data Model v2 credentials in SD-JWT format.
SdJwtSignerAdapter
Adapter to wrap the DidSigner for SD-JWT signing operations.
Secp256k1KeyPair
A key pair implementation that uses secp256k1 for crypto operations.
Secp256k1Signature2019Generator
Generates Linked Data Proofs using the EcdsaSecp256k1Signature2019 signature suite.
Secp256k1Signature2019Verifier
Verifies Linked Data Proofs signed with the EcdsaSecp256k1Signature2019 signature suite.
ServiceEndpoint
Represents a service endpoint in a DID Document. Following https://www.w3.org/TR/did-1.0/#services
ServiceEndpointValue
Represents the value of a service endpoint in a DID Document.
ServiceType
Represents the type of a service in a DID Document. According to https://www.w3.org/TR/did-1.0/#services, the type property can be a string or a set of strings.
SetEndpoint
Represents a service endpoint that is a set of endpoints.
SetServiceType
A service type represented as a set of strings.
StoredKey
Represents information about a key stored in the KeyStore.
StringEndpoint
Represents a service endpoint that is a single URL string.
StringServiceType
A service type represented as a single string.
TermsOfUse
Represents a termsOfUse for verifiable credentials following W3C standards.
UniversalDIDResolver
A class for resolving multiple DID methods.
UniversalParser
Entry point to all supported Verifiable Credential (VC) parsers.
UniversalPresentationParser
Entry point to all supported VC parsers
UniversalPresentationVerifier
Verifies a ParsedVerifiablePresentation using a set of default and custom verifiers. Allows verification of any supported VC encodings.
UniversalVerifier
Allows verification of any supported Verifiable Credential (VC) encodings.
VcDataModelV1
Represents a Verifiable Credential (VC) according to the W3C VC Data Model v1.1.
VcDataModelV2
Represents a Verifiable Credential (VC) according to the W3C VC Data Model v2.
VcExpiryVerifier
Verifier that checks the validity period of a Verifiable Credential (VC).
VcIntegrityVerifier
Verifier that checks the cryptographic integrity of a Verifiable Credential (VC).
VcSuites
Registry of all supported Verifiable Credential suites.
VcVerifier
Interface for verifying Verifiable Credentials (VCs).
VerifiableCredential
A tamper-evident credential whose authorship can be cryptographically verified.
VerifiableCredentialSuite<SerializedType, VC extends VerifiableCredential, ParsedVC extends ParsedVerifiableCredential<SerializedType>>
Defines operations for working with encoded Verifiable Credentials.
VerifiableDataParser<SerializedType, DecodedType>
Interface for parsers that decode serialized verifiable data.
VerifiablePresentation
Abstract base class for a Verifiable Presentation (VP).
VerifiablePresentationSuite<SerializedType, VP extends VerifiablePresentation, ParsedVP extends ParsedVerifiablePresentation<SerializedType>>
Defines operations for working with Verifiable Presentations.
VerificationMethod
Represents a verification method in a DID Document.
VerificationMethodBase58
Represents a verification method using base58 encoding.
VerificationMethodJwk
Represents a verification method using JWK.
VerificationMethodMultibase
Represents a verification method using multibase encoding.
VerificationMethodRef
Represents a reference to a verification method.
VerificationResult
Result of a verification.
Verifier
Interface for verifying signature
VpDataModelV1
Represents a Verifiable Presentation (VP) according to the W3C VC Data Model v1.1.
VpDataModelV2
Represents a Verifiable Presentation (VP) according to the W3C VC Data Model v1.1.
VpDomainChallengeVerifier
A verifier that checks domain and challenge are valid in proof
VpExpiryVerifier
A verifier that checks whether any of the credentials in a Verifiable Presentation (VP) have expired.
VpIntegrityVerifier
Verifier that ensures the integrity of the Verifiable Presentation (VP). VpIntegrityVerifier handles VP-level integrity checks only. Use VcIntegrityVerifier for individual credential verification within the VP. This verifier fails fast: it stops at the first encountered integrity issue. Example:
VpSuites
/// Registry of all supported Verifiable Presentation suites.
VpVerifier
Interface for verifying Verifiable Presentations (VPs).
Wallet
Interface for a wallet
Witness
A single witness identified by their DID.
WitnessParameter
Represents a witness parameter used in the DID WebVH log verification process.
WitnessVerificationResult
Result of witness verification for a DID:WebVH log entry.

Enums

DidPeerType
Supported DID peer types.
HashingAlgorithm
Supported hashing algorithms.
KeyType
Supported key types.
MediaTypes
Enum representing supported media types for enveloped Verifiable Credentials.
MultiBase
Supported multibase encodings.
MultiKeyIndicator
Supported multikey indicators.
Numalgo2Prefix
Enum representing the prefixes used in encoding for peer DIDs.
ProofPurpose
Defines the purpose for which a cryptographic proof can be used.
SignatureScheme
Supported signature schemes. Set of supported signature schemes, all schemes must be fully specified including hashing algorithm, curve and key material requirements.
SsiExceptionType
To be not be exposed from common package
VcDataModelV1Key
Defines the keys used in the MutableVcDataModelV1 class.
VcDataModelV2Key
Defines the keys used in the MutableVcDataModelV2 class.
VerificationRelationship
Defines the purpose of a verification method within a DID Document.
VpDataModelV1Key
Defines the keys for accessing properties within the MutableVpDataModelV1 data model.
VpDataModelV2Key
Defines the keys for accessing properties within the MutableVpDataModelV2 data model.

Mixins

JwtParser
Mixin that provides functionality for parsing JWT/JWS formatted data.
LdParser
Mixin that provides functionality for parsing JSON-LD formatted data.
SdJwtParser
Mixin that provides functionality for parsing SD-JWT formatted data.

Extensions

ServiceEndpointValueParser on ServiceEndpointValue
Extension to handle JSON parsing for ServiceEndpointValue.

Constants

cryptosuiteToScheme → const Map<String, List<SignatureScheme>>
Maps W3C cryptosuite identifiers to their corresponding SignatureScheme(s).
delegationVcType → const String
Type identifier used to recognize Delegation VCs
dmV1ContextUrl → const String
Default VC Data Model v1.1 context url
dmV2ContextUrl → const String
Default VC Data Model v2 context url

Properties

b256 BigInt
The value 256 as a BigInt.
final
keyIndicators Map<KeyType, MultiKeyIndicator>
Returns a map of KeyType to MultiKeyIndicator.
final
mediaTypeSuites Map<String, VerifiableCredentialSuite<dynamic, VerifiableCredential, ParsedVerifiableCredential>>
Mapping between media type strings and their corresponding VC suites.
final
peerDIDPattern RegExp
Regular expression pattern for matching peer DIDs.
final

Functions

areJwksEqual(Map<String, dynamic> jwk1, Map<String, dynamic> jwk2) bool
Compares two JWK objects for cryptographic equality.
decodeBigInt(Uint8List bytes) BigInt
Decodes a Uint8List to a BigInt.
decodeVarint(Uint8List varint, {int start = 0}) → (Uint8List, int)
Returns a decoded varint staring at the first byte of varint and the number of bytes read.
didWebToUri(String didWeb) Uri
Converts a did:web identifier into a Uri pointing to its DID document.
downloadDocument(Uri url, {Client? client, Duration timeout = const Duration(seconds: 30)}) Future<String>
Downloads a document from the specified URL and returns the response body.
encodeBigInt(BigInt number) Uint8List
Encodes a BigInt to a Uint8List.
getCredentialStatusFromVc(ParsedVerifiableCredential vc) List
Extracts and parses all RevocationList2020Status entries from a VC.
getEcdsaJcsSignatureScheme(Map<String, dynamic> jwkMap) SignatureScheme
Determines the SignatureScheme for ecdsa-jcs-2019 from a JWK.
getEcdsaSignatureScheme(Map<String, dynamic> jwkMap) SignatureScheme
Determines the SignatureScheme for ECDSA cryptosuites from a JWK.
isPeerDID(String peerDID) bool
Validates if a given string matches the peer DID pattern.
isUri(String uri) bool
Checks if the given string is a valid URI.
jwkToMultiKey(Map<String, dynamic> jwk) Uint8List
Converts a JWK map to a multikey.
keyToJwk(PublicKey publicKey) Map<String, String>
Converts a public key to a JWK map.
multiBaseToUint8List(String multibase) Uint8List
Converts a multibase string to a Uint8List.
multiKeyToJwk(Uint8List multikey) Map<String, String>
Converts a multikey to a JWK map.
toMultiBase(Uint8List multibase, {MultiBase base = MultiBase.base58bitcoin}) String
Converts bytes to a multibase string.
toMultikey(Uint8List pubKeyBytes, KeyType keyType) Uint8List
Converts a public key and key type to a multikey Uint8List.

Typedefs

DataIntegrityEcdsaGenerator = DataIntegrityEcdsaRdfcGenerator
Generates Data Integrity Proofs using the ecdsa-rdfc-2019 cryptosuite.
DataIntegrityEddsaGenerator = DataIntegrityEddsaRdfcGenerator
Generates Data Integrity Proofs using the eddsa-rdfc-2022 cryptosuite.
DocumentLoader = Future<Map<String, dynamic>?> Function(Uri url)
Function type for loading external documents referenced in proofs.

Exceptions / Errors

JsonLdException
Exception thrown during JSON-LD processing operations.
RemoteContextLoadException
Exception thrown when a remote context fails to load.
SsiDidResolutionException
Exception thrown during DID resolution operations.
SsiException
Represents an SSI exception.