aboutsummaryrefslogtreecommitdiff
path: root/src/cz/crcs/ectester/reader/command/Command.java
diff options
context:
space:
mode:
authorJ08nY2018-11-09 19:42:35 +0100
committerJ08nY2018-11-09 19:42:35 +0100
commit9e157bc1d0a42848bb8f780f4f7b294ad535feda (patch)
treef2a36762e63501eb3d5c0156146572bda7e80a78 /src/cz/crcs/ectester/reader/command/Command.java
parentf0ae5fdc1ba778acc922d5269a5523a88ca97976 (diff)
downloadECTester-9e157bc1d0a42848bb8f780f4f7b294ad535feda.tar.gz
ECTester-9e157bc1d0a42848bb8f780f4f7b294ad535feda.tar.zst
ECTester-9e157bc1d0a42848bb8f780f4f7b294ad535feda.zip
Diffstat (limited to 'src/cz/crcs/ectester/reader/command/Command.java')
-rw-r--r--src/cz/crcs/ectester/reader/command/Command.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/cz/crcs/ectester/reader/command/Command.java b/src/cz/crcs/ectester/reader/command/Command.java
index d2e08ee..7a3f3b0 100644
--- a/src/cz/crcs/ectester/reader/command/Command.java
+++ b/src/cz/crcs/ectester/reader/command/Command.java
@@ -133,6 +133,9 @@ public abstract class Command implements Cloneable {
} else {
keypair = dataStore.getObject(EC_Keypair.class, cfg.namedKey);
}
+ if (keypair == null) {
+ throw new IOException("KeyPair not found.");
+ }
data = keypair.flatten();
if (data == null) {
@@ -155,6 +158,9 @@ public abstract class Command implements Cloneable {
pub = dataStore.getObject(EC_Keypair.class, cfg.namedPublicKey);
}
}
+ if (pub == null) {
+ throw new IOException("Public key not found.");
+ }
byte[] pubkey = pub.flatten(EC_Consts.PARAMETER_W);
if (pubkey == null) {
@@ -177,6 +183,9 @@ public abstract class Command implements Cloneable {
priv = dataStore.getObject(EC_Keypair.class, cfg.namedPrivateKey);
}
}
+ if (priv == null) {
+ throw new IOException("Private key not found.");
+ }
byte[] privkey = priv.flatten(EC_Consts.PARAMETER_S);
if (privkey == null) {