private int validateIterationCount(BigInteger i) { int count = i.intValue(); if (count < 0) { throw new IllegalStateException("negative iteration count found"); } BigInteger maxValue = Properties.asBigInteger(PKCS12_MAX_IT_COUNT_PROPERTY); if (maxValue != null) { if (maxValue.intValue() < count) { throw new IllegalStateException("iteration count " + count + " greater than " + maxValue.intValue()); } } return count; }