}
void checkNonce(String nonce) {
// check response_nonce to prevent replay-attack:
if (nonce==null || nonce.length()<20){
throw new OpenIdException("Verify failed.");
}
// make sure the time of server is correct:
long nonceTime = getNonceTime(nonce);
long diff = Math.abs(System.currentTimeMillis() - nonceTime);
if (diff > Constants.ONE_HOUR){
throw new OpenIdException("Bad nonce time.");
}
}