public boolean verifyTimestampImprint ( ) throws NoSuchAlgorithmException { if ( timeStampToken == null ) return false ; MessageImprint imprint = timeStampToken . getTimeStampInfo ( ) . toASN1Structure ( ) . getMessageImprint ( ) ; byte [ ] md = MessageDigest . getInstance ( "SHA-1" ) . digest ( digest ) ; byte [ ] imphashed = imprint . getHashedMessage ( ) ; boolean res = Arrays . equals ( md , imphashed ) ; return res ; }
Checks if the timestamp refers to this document .