The parameters for the conversion.
The multibase identifier string of the key.
An object containing the key as a Uint8Array
and its multicodec code and name.
This function decodes a multibase identifier back into a cryptographic key. It first decodes the
identifier from multibase format into Base58 format, and then converts it into a Uint8Array
.
Afterward, it removes the multicodec prefix, extracting the raw key data along with the
multicodec code and name.
const multibaseKeyId = '...'; // Multibase identifier of the key
const { key, multicodecCode, multicodecName } = multibaseIdToKey({ multibaseKeyId });
DidError
if the multibase identifier is invalid.
Converts a multibase identifier to a cryptographic key.