summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Hagemeister2014-10-15 15:56:56 +0200
committerBjörn Hagemeister2014-10-15 15:56:56 +0200
commitc8ae4fdbf70bb20ccf7c687b772d5296909a56d1 (patch)
treed527c9f39274c4f3b1944a80e4a8a05f245c19a3
parentImplemented --importId command line option and adapted TODO.txt. (diff)
downloadsatellite-daemon-c8ae4fdbf70bb20ccf7c687b772d5296909a56d1.tar.gz
satellite-daemon-c8ae4fdbf70bb20ccf7c687b772d5296909a56d1.tar.xz
satellite-daemon-c8ae4fdbf70bb20ccf7c687b772d5296909a56d1.zip
Added failure information.
-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 );
}