Skip to main content

extractPublicKeyHex() function

This API is provided as a beta 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,
): {
publicKeyHex: string
keyType: string | undefined
}

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:

{ publicKeyHex: string; keyType: string | undefined; }

the hex encoding of the public key along with the inferred key type

This API may change without a BREAKING CHANGE notice.