public BlobStoreWriter(BlobStore store)
        {
            this.store = store;
            try
            {
                sha1Digest = MessageDigest.GetInstance("SHA-1");
                sha1Digest.Reset();
                md5Digest = MessageDigest.GetInstance("MD5");
                md5Digest.Reset();
            } catch (NotSupportedException e) {
                throw Misc.CreateExceptionAndLog(Log.To.Database, e, Tag,
                    "Could not get an instance of SHA-1 or MD5 for BlobStoreWriter.");
            }

            try {
                OpenTempFile();
            } catch (FileNotFoundException e) {
                throw Misc.CreateExceptionAndLog(Log.To.Database, e, Tag,
                    "Unable to open temporary file for BlobStoreWriter.");
            }
        }
        internal bool HashPasswordToDigest(string user, MessageDigest digest)
        {
            return IteratePassword(user, b =>
            {
                digest.Update(b);
                return true;
            });

        }