A utility class for creating CIP-8 / COSE signatures using Cardano types.

These functions produce the necessary COSE_Sign1 and COSE_Key structures required by the CIP-30 signData API.

Methods

Methods

  • Signs arbitrary data and binds the signature to a Cardano address.

    Parameters

    • message: Uint8Array

      The raw message bytes to sign.

    • address: Address

      The Cardano address object.

    • signingKey: Ed25519PrivateKey

      The Ed25519 private key object.

    Returns Cip8SignResult

    • An object containing the COSE_Sign1 and COSE_Key buffers.
    • If the signing fails or inputs are invalid.
  • Signs arbitrary data and binds the signature to a key hash.

    Parameters

    • message: Uint8Array

      The raw message bytes to sign.

    • keyHash: Uint8Array

      The raw bytes of the Blake2b-224 key hash (28 bytes) to bind the signature to.

    • signingKey: Ed25519PrivateKey

      The Ed25519 private key wrapper object.

    Returns Cip8SignResult

    • An object containing the COSE_Sign1 and COSE_Key buffers.
    • If the signing fails or inputs are invalid.