dOut.writeInt(iterationCount);
cipher = this.makePBECipher(STORE_CIPHER, Cipher.ENCRYPT_MODE, password, salt, iterationCount);
CipherOutputStream cOut = new CipherOutputStream(dOut, cipher);
DigestOutputStream dgOut = new DigestOutputStream(cOut, new SHA1Digest());
this.saveStore(dgOut);
Digest dig = dgOut.getDigest();
byte[] hash = new byte[dig.getDigestSize()];
dig.doFinal(hash, 0);
cOut.write(hash);