createDidKeyResolver
@atiproto/key-resolver
Returns a KeyResolver that parses did:key: references locally and rejects everything else. No network I/O. Matches the behavior the verify function uses by default. Exposed here as a factory so consumers can compose it with other resolvers explicitly.
Signature
typescript
function createDidKeyResolver(): KeyResolver
Usage
typescript
import { verify } from "@atiproto/atproto-attestation";import { createDidKeyResolver } from "@atiproto/key-resolver";const keyResolver = createDidKeyResolver();const result = await verify({record,repository: "did:plc:recipient",keyResolver,});
When to use it
When your signers only use did:key: identities. Using this factory rather than the verifier default makes the dependency explicit in code review and makes it trivial to switch to createFetchKeyResolver later without changing the call site.