DidResolver

fun interface DidResolver

Functional interface for resolving DIDs to DID documents.

This is the native DID resolver interface used throughout the codebase. All modules (did:core, credentials:core, trust) use this interface.

Example Usage:

val resolver: DidResolver = DidResolver { did ->
// Resolve DID and return DidResolutionResult
DidResolutionResult.Success(document = didDocument)
}

val did = Did("did:key:123")
val result = resolver.resolve(did)
when (result) {
is DidResolutionResult.Success -> println(result.document.id)
is DidResolutionResult.Failure.NotFound -> println("Not found")
// ... handle other cases
}

Inheritors

Functions

Link copied to clipboard
abstract suspend fun resolve(did: Did): DidResolutionResult

Resolves a DID to a DID resolution result.

open suspend fun resolve(did: Did, options: ResolutionOptions): DidResolutionResult

Resolves a DID with DID Resolution 1.0 §4.1 resolution options.

Link copied to clipboard

Resolves a DID and returns the document, or null if it could not be resolved.

Link copied to clipboard

Resolves a DID and returns the document, or throws if not found.