public TSRequest(String tSAPolicyID,byte[] toBeTimeStamped,MessageDigest messageDigest) throws NoSuchAlgorithmException {
  this.policyId=tSAPolicyID;
  this.hashAlgorithmId=AlgorithmId.get(messageDigest.getAlgorithm());
  this.hashValue=messageDigest.digest(toBeTimeStamped);
}

public TSRequest ( String tSAPolicyID , byte [ ] toBeTimeStamped , MessageDigest messageDigest ) throws NoSuchAlgorithmException { this . policyId = tSAPolicyID ; this . hashAlgorithmId = AlgorithmId . get ( messageDigest . getAlgorithm ( ) ) ; this . hashValue = messageDigest . digest ( toBeTimeStamped ) ; }
constructs a timestamp request for the supplied data .
