Skip to main content

extractPublicKeyHex() function

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Converts the publicKey of a VerificationMethod to hex encoding (publicKeyHex)

Signature:

export declare function extractPublicKeyHex(pk: _ExtendedVerificationMethod, convert?: boolean): string

Parameters

ParameterTypeDescription
pk_ExtendedVerificationMethodthe VerificationMethod to be converted
convertboolean(Optional) when this flag is set to true, Ed25519 keys are converted to their X25519 pairs

Returns:

string

the hex encoding of the public key

This API may change without a BREAKING CHANGE notice.