LTO Network
Search…
Identities
The LTO identity library supports resolving DIDs to DID documents. It's DID method independent.

Resolver

1
use LTO\Identity\Resolver\LTONetwork as LTOResolver;
2
3
$resolver = new LTOResolver();
4
5
$identity = $resolver->resolve("lto:did:3JkihPXS5iPs8xDKcFQmhR8TVcAmDRUZpyx");
Copied!
The Resolver class can be used to combine multiple resolvers.
1
use LTO\Identity\Resolver;
2
use LTO\Identity\Resolver\LTONetwork as LTOResolver;
3
use LTO\Identity\Resolver\WebNetwork as WebResolver;
4
5
$resolver = new Resolver(
6
new LTOResolver(),
7
new WebResolver(),
8
);
9
10
$identity = $resolver->resolve("lto:did:3JkihPXS5iPs8xDKcFQmhR8TVcAmDRUZpyx");
Copied!

Identity

The identity is a representation of a DID document.
After a signature or JWT is verified, use hasVerificationMethod() to check if the public key used in the verification belongs to the identity.
1
$method = [
2
"type": "Ed25519VerificationKey2018",
3
"publicKeyBase58": "H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV",
4
];
5
6
$identity->hasVerificationMethod($method);
Copied!
Optionally check if the verification method can be used for a specific purpose
1
use LTO\Identity\VerificationMethod;
2
3
$identity->hasVerificationMethod($method, VerificationMethod\Authentication);
Copied!
Copy link