Various utility functions; not meant to be exported to the external world...

Functions

f
algorithmDataCR

Mapping of the CryptoKey instance and the corresponding terms for the WebCrypto API like sign or verify.

f
bytesToText

Array buffer to text, needed for crypto operations. The text is decoded from UTF-8, which is the default for the WebCrypto API.

f
decodeResult

Decode a string from encoded form. If the text is recognized as Multibase, the encoding format is there, otherwise the options argument rules.

f
encodeResult

Encode the result in base58 or base64, possibly in Multibase. The options argument dictates. Default is base64 encoding and plain output.

f
isCryptoKey

Type guard for a CryptoKey object.

f
isCryptoKeyPair

Type guard for a CryptoKeyPair object.

f
isJWKKeyPair

Type guard for a JWK Key Pair

f
isMultibase

Type guard for a Multibase value.

f
isMultikey

Type guard for a Multikey object.

f
textToBytes

Text to array buffer, needed for crypto operations. The text is encoded in UTF-8, which is the default for the WebCrypto API.

Interfaces

I
WebCryptoAPIData

Additional structure needed for operations such as sign or verify in the WebCrypto API. Can be extracted from the WebCrypto representation of the crypto keys, see algorithmDataCR.