public static byte[] sign(Signature signatureAlgorithm,PrivateKey privateKey,byte[] contentBytes) throws InvalidKeyException, SignatureException {
  signatureAlgorithm.initSign(privateKey);
  signatureAlgorithm.update(contentBytes);
  return signatureAlgorithm.sign();
}

public static byte [ ] sign ( Signature signatureAlgorithm , PrivateKey privateKey , byte [ ] contentBytes ) throws InvalidKeyException , SignatureException { signatureAlgorithm . initSign ( privateKey ) ; signatureAlgorithm . update ( contentBytes ) ; return signatureAlgorithm . sign ( ) ; }
signs content using a private key .
