code: @Override
      public byte[] sign(byte[] data, Key key) throws AuditSigningException {
          if (tc.isEntryEnabled())
              Tr.entry(tc, "sign");
  
          byte[] messageDigest = null;
          byte[] signedData = null;
          MessageDigest md = null;
          try {
              md = MessageDigest.getInstance("SHA-256");
          } catch (java.security.NoSuchAlgorithmException e) {
              throw new AuditSigningException(e);
          }
          if (data != null) {
              md.reset();
              md.update(data);
              messageDigest = md.digest();
          } else {
              Tr.error(tc, "security.audit.signing.data.error");
              throw new AuditSigningException("Invalid data passed into signing algorithm");
          }
  
          if (messageDigest != null) {
              try {
                  signedData = encrypt(messageDigest, key);
              } catch (AuditEncryptingException aee) {
                  throw new AuditSigningException(aee);
              }
          } else {
              Tr.error(tc, "security.audit.message.digest.error");
              throw new AuditSigningException("MessageDigest is invalid");
          }
  
          return (signedData);
      }
docs: <p>
  The <code>sign</code> method signs the data with a key
  </p>
  
  @param a byte array of data to be used to compute a message digest
  @param the key used to sign the message digest
  @returns a byte array representing the signed message digest
  @throws AuditSigningException