summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/org/openslx/satellitedaemon/App.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/org/openslx/satellitedaemon/App.java b/src/main/java/org/openslx/satellitedaemon/App.java
index b413280..24a9f2b 100644
--- a/src/main/java/org/openslx/satellitedaemon/App.java
+++ b/src/main/java/org/openslx/satellitedaemon/App.java
@@ -38,6 +38,7 @@ public class App
if ( checkConfig() ) {
System.exit( 0 );
}
+ log.error( "Config not valid: existing modulus, private and public exponent no valid key pair." );
System.exit( 2 );
} else if ( arg.equals( "--genid" ) ) {
if ( i < args.length ) {
@@ -52,7 +53,7 @@ public class App
System.exit( 2 );
}
} else if ( arg.equals( "--import" ) ) {
- if ( ( i + 3 ) < args.length ) {
+ if ( ( i + 4 ) < args.length ) {
log.error( "Illelgal option: '--import' requires 4 arguments, <OrgName> <Modulus> <priv_Exponent> <pub_Exponent>" );
System.exit( 2 );
} else {
@@ -127,8 +128,10 @@ public class App
private static boolean importId( String organizationName, BigInteger modulus, BigInteger privExp, BigInteger pubExp )
{
- if ( !Identity.isValidKeyPair( modulus, privExp, pubExp ) )
+ if ( !Identity.isValidKeyPair( modulus, privExp, pubExp ) ) {
+ log.error( "Given arguments not valid: given modulus, private and public exponent no valid key pair." );
return false;
+ }
return Identity.importIdentity( organizationName, modulus, privExp, pubExp );
}