class LazySecretKeyImpl implements LazySecretKey {

    @Override
    public SecretKey getOrCreate() throws Exception {
        synchronized (lock) {
            if (secretKey == null) {
                File secretFile = getSecretFile(confDirs);
                if (secretFile == null) {
                    secretFile = new File(confDirs.get(0), SECRET_FILE_NAME);
                    secretKey = Encryption.generateNewKey();
                    Files.write(secretKey.getEncoded(), secretFile);
                } else {
                    secretKey = loadKey(secretFile);
                }
            }
            return secretKey;
        }
    }

      LazySecretKeyImpl(List<File> confDirs);

}