public boolean verifyDigest ( int digestPos , byte [ ] handshakeMessage , byte [ ] key , int keyLen ) { if ( log . isTraceEnabled ( ) ) { log . trace ( "verifyDigest - digestPos: {} keyLen: {} handshake size: {} " , digestPos , keyLen , handshakeMessage . length ) ; } byte [ ] calcDigest = new byte [ DIGEST_LENGTH ] ; calculateDigest ( digestPos , handshakeMessage , 0 , key , keyLen , calcDigest , 0 ) ; if ( ! Arrays . equals ( Arrays . copyOfRange ( handshakeMessage , digestPos , ( digestPos + DIGEST_LENGTH ) ) , calcDigest ) ) { return false ; } return true ; }
Verifies the digest .