Use System.err to communicate  with end users.
@@ -38,7 +38,7 @@ public class KeyDataAdapter extends XmlAdapter<KeyData, KeyData> {
}
if (keyData.getPublicKeyPath() == null || keyData.getPrivateKeyPath() == null) {
- LOGGER.error("When providing key paths, must give both as paths, not just one");
+ System.err.println("When providing key paths, must give both as paths, not just one");
throw new IllegalArgumentException("When providing key paths, must give both public and private");
}
@@ -88,9 +88,11 @@ public class KeyDataAdapter extends XmlAdapter<KeyData, KeyData> {
}
if (keyData.getConfig().getPassword() == null) {
- LOGGER.error("A locked key was provided without a password");
- LOGGER.error("Please ensure the same number of passwords are provided as there are keys");
- LOGGER.error("and remember to include empty passwords for unlocked keys");
+
+ System.err.println("A locked key was provided without a password. ");
+ System.err.println("Please ensure the same number of passwords are provided as there are keys ");
+ System.err.print("and remember to include empty passwords for unlocked keys");
+ System.err.println();
throw new IllegalArgumentException("Password missing");
}
@@ -107,7 +109,7 @@ public class KeyDataAdapter extends XmlAdapter<KeyData, KeyData> {
keyData.getPublicKeyPath()
);
} catch (final NaclException ex) {
- LOGGER.error("Could not decrypt the private key with the provided password, please double check the passwords provided");
+ System.err.println("Could not decrypt the private key with the provided password, please double check the passwords provided");
throw new IllegalArgumentException();
}
