Base conversion functions for ECDSA. The Multikey definition requires the usage of a compressed public key which must be compressed when creating the Multikey representation, and decompressed for the JWK conversion.
The two exported functions, used by the rest of the package, just branch out to the internal functions that do the key (de)compression itself.
Licensed by under the W3C Software and Document License, https://www.w3.org/Consortium/Legal/copyright-software. Copyright ©2024 World Wide Web Consortium. https://www.w3.org/copyright/software-license-2023/
Convert the Crypto values from JWK to the equivalent Multikey Pairs' binary data. The final encoding, with preambles, are done in the general level.
Convert the multikey values to their JWK equivalents. The final x
and d
values are encoded
in base64 and then the relevant JWK structure are created
Usage
import * as mod from "lib/ecdsa.ts";