Dont provide default encrptor config intenally. Require that config
has config defined.
@@ -17,8 +17,6 @@ import java.util.stream.Collectors;
import java.util.stream.Stream;
import static java.nio.file.StandardOpenOption.APPEND;
-import java.util.Collections;
-import java.util.Optional;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
@@ -41,15 +39,7 @@ public class JaxbConfigFactory implements ConfigFactory {
final Config initialConfig = JaxbUtil.unmarshal(new ByteArrayInputStream(originalData), Config.class);
- EncryptorConfig encryptorConfig =
- Optional.ofNullable(initialConfig.getEncryptor())
- .orElse(
- new EncryptorConfig() {
- {
- setType(EncryptorType.NACL);
- setProperties(Collections.emptyMap());
- }
- });
+ EncryptorConfig encryptorConfig = Objects.requireNonNull(initialConfig.getEncryptor());
// Initialise the key encrypter it will store into holder object.
KeyEncryptorFactory.newFactory().create(encryptorConfig);
