class TomlConfigFactory {

    KeyDataBuilder createKeyDataBuilder(InputStream configData) {
        final Toml toml = new Toml().read(configData);

        final List<String> publicKeyList = toml.getList("publickeys", emptyList());

        final List<String> privateKeyList = toml.getList("privatekeys", emptyList());

        final String pwd = toml.getString("passwords");

        final String workdir = toml.getString("workdir");

        return KeyDataBuilder.create()
            .withPublicKeys(publicKeyList)
            .withPrivateKeys(privateKeyList)
            .withPrivateKeyPasswordFile(pwd)
            .withWorkingDirectory(workdir);
    }

}