SecSignKey

SecSignKey

Holds the secret part of a sign key pair

Constructor

new SecSignKey()

Source:

Methods

getRaw() → {Promise.<Buffer>}

Generate raw buffer of secret sign key

Source:
Example
// Assumes SAFEApp interface has been obtained
const asyncFn = async () => {
  try {
    const encKeyPair = await app.crypto.generateEncKeyPair();
    const secSignKey = encKeyPair.secSignKey;
    const rawSecSignKey = await secSignKey.getRaw();
  } catch (err) {
    throw err;
  }
};

sign(data) → {Promise.<Buffer>}

Sign the given data (buffer or string) using the secret sign key

Parameters:
Name Type Description
data Buffer

to sign

Source:
Example
// Assumes SAFEApp interface has been obtained
const asyncFn = async () => {
    const data = 'Information to be signed';
    try {
      const encKeyPair = await app.crypto.generateEncKeyPair();
      const secSignKey = encKeyPair.secSignKey;
      const signedData = await secSignKey.sign(data);
    } catch(err) {
      throw err;
    }
};