toip.tools

function · Browser and Node

resolveDidKey

Resolves an Ed25519 did:key locally and derives its X25519 public key without network access.

@toip-tools/trust-coreView source
TypeScriptImport
import { resolveDidKey } from "@toip-tools/trust-core";

Declaration

TypeScriptSignature
resolveDidKey(did: string): {
    signingKey: Uint8Array;
    encryptionKey: Uint8Array;
};

Parameters

didrequired
string

The Ed25519 did:key identifier to decode.

Returns

{ signingKey: Uint8Array; encryptionKey: Uint8Array; }

Public keys for verifying signatures and encrypting to this identity.

Returned object

The returned object exposes these properties and methods.

Properties

signingKeyrequired
Uint8Array<ArrayBufferLike>
encryptionKeyrequired
Uint8Array<ArrayBufferLike>

Throws

If the identifier cannot be decoded or does not name an Ed25519 did:key.