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