public static byte[] digest(final DigestAlgorithm digestAlgorithm,final byte[] data) throws DSSException {
  final MessageDigest messageDigest=getMessageDigest(digestAlgorithm);
  final byte[] digestValue=messageDigest.digest(data);
  return digestValue;
}

public static byte [ ] digest ( final DigestAlgorithm digestAlgorithm , final byte [ ] data ) throws DSSException { final MessageDigest messageDigest = getMessageDigest ( digestAlgorithm ) ; final byte [ ] digestValue = messageDigest . digest ( data ) ; return digestValue ; }
this method allows to digest the data with the given algorithm .
