function sign(privateKeyArmored, passphrase, data) {
  logger.info('Sign');
  return new Promise(async (fulfill, reject) => {
    const { keys: [privateKey] } = await openpgp.key.readArmored(privateKeyArmored);
    privateKey.decrypt(passphrase);
    const { signature: detachedSignature } = await openpgp.sign({
      message: openpgp.cleartext.fromText(data), // CleartextMessage or Message object
      privateKeys: [privateKey], // for signing
      detached: true,
    });
    fulfill(detachedSignature);
  });
}
/**
 * Signs data using a private pgp key
 * @func
 * @param privateKeyArmored {string} the key to sign the data with
 * @param passphrase {string} the passphrase to use the key
 * @param data {object} data to sign
 */
Signs data using a private pgp key
@func
@param privateKeyArmored {string} the key to sign the data with
@param passphrase {string} the passphrase to use the key
@param data {object} data to sign
Signs data using a private pgp key @func @param privateKeyArmored { string } the key to sign the data with @param passphrase { string } the passphrase to use the key @param data { object } data to sign
function sign(privateKeyArmored, passphrase, data) {
  logger.info('Sign');
  return new Promise(async (fulfill, reject) => {
    const { keys: [privateKey] } = await openpgp.key.readArmored(privateKeyArmored);
    privateKey.decrypt(passphrase);
    const { signature: detachedSignature } = await openpgp.sign({
      message: openpgp.cleartext.fromText(data), 
      privateKeys: [privateKey], 
      detached: true,
    });
    fulfill(detachedSignature);
  });
}
function sign ( privateKeyArmored , passphrase , data ) { logger . info ( 'Sign' ) ; return new Promise ( async ( fulfill , reject ) => { const { keys : [ privateKey ] } = await openpgp . key . readArmored ( privateKeyArmored ) ; privateKey . decrypt ( passphrase ) ; const { signature : detachedSignature } = await openpgp . sign ( { message : openpgp . cleartext . fromText ( data ) , privateKeys : [ privateKey ] , detached : true , } ) ; fulfill ( detachedSignature ) ; } ) ; }
Signs data using a private pgp key
 @func
 @param privateKeyArmored {string} the key to sign the data with
 @param passphrase {string} the passphrase to use the key
 @param data {object} data to sign
Signs data using a private pgp key @func @param privateKeyArmored { string } the key to sign the data with @param passphrase { string } the passphrase to use the key @param data { object } data to sign
// CleartextMessage or Message object
 // for signing
