diff options
Diffstat (limited to 'src/cz/crcs/ectester/reader/command/Command.java')
| -rw-r--r-- | src/cz/crcs/ectester/reader/command/Command.java | 9 |
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) { |
