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), with no 0x prefix. Secp256k1 public keys are compressed.
Signature:
export declare function extractPublicKeyHex(
pk: _ExtendedVerificationMethod,
convert?: boolean,
): {
publicKeyHex: string
keyType: string | undefined
}
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
pk |
_ExtendedVerificationMethod |
the VerificationMethod to be converted |
|
convert |
boolean |
(Optional) when this flag is set to true, Ed25519 keys are converted to their X25519 pairs |
{ 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.