Client JS Library

The MIRACL Trust platform provides a Designated Verifier Signature (DVS) scheme for digital signing that you can integrate directly into your web applications through the platform’s Client JS Library. As a preliminary step, you must install and set it up as described in MIRACL Trust Client JS Library.

# Generate Signature

To generate a signature for signing a document, use the sign method as follows:

mcl.sign(
  userId,
  pin,
  documentHash,
  documentTimestamp,
  function callback(err, signature) {
    if (err) {
      // Handle any potential errors
      return;
    }
    console.log(signature);
  },
);

# Verify Signature

The signature must be verified on the back end. For more information, see Digital Signatures.