findTrustPath

suspend fun findTrustPath(verifier: VerifierIdentity, issuer: IssuerIdentity, timeout: Duration = 10.seconds): TrustPath

Find a trust path between verifier and issuer (first-class type).

Returns a sealed TrustPath type that makes trust relationships explicit.

Example:

when (val path = trustWeave.findTrustPath(verifier, issuer, timeout = 10.seconds)) {
is TrustPath.Verified -> {
println("Trusted via path: ${path.anchors.map { it.did }}")
println("Path length: ${path.length}")
println("Trust score: ${path.trustScore}")
}
is TrustPath.NotFound -> {
println("No trust path found: ${path.reason}")
}
}

Return

TrustPath.Verified if a path exists, TrustPath.NotFound otherwise

Parameters

verifier

The verifier identity

issuer

The issuer identity

timeout

Maximum time to wait for trust path discovery (default: 10 seconds)

Throws

if trust registry is not configured