diff options
| author | J08nY | 2018-05-28 20:06:18 +0200 |
|---|---|---|
| committer | J08nY | 2018-05-28 20:06:18 +0200 |
| commit | a4e52b21b1dad5f96df409c44e5b4d611bba01b9 (patch) | |
| tree | 36f9d21894fc702a4f544bd0145b403ba3930074 /src/cz/crcs/ectester/standalone/test/KeyGeneratorTestable.java | |
| parent | ff6be88e469608a67945a274ec2180aee3f3ccd2 (diff) | |
| download | ECTester-a4e52b21b1dad5f96df409c44e5b4d611bba01b9.tar.gz ECTester-a4e52b21b1dad5f96df409c44e5b4d611bba01b9.tar.zst ECTester-a4e52b21b1dad5f96df409c44e5b4d611bba01b9.zip | |
Implement tracking of stage of execution of standalone testables.
- Output this stage in all the formats.
Diffstat (limited to 'src/cz/crcs/ectester/standalone/test/KeyGeneratorTestable.java')
| -rw-r--r-- | src/cz/crcs/ectester/standalone/test/KeyGeneratorTestable.java | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/src/cz/crcs/ectester/standalone/test/KeyGeneratorTestable.java b/src/cz/crcs/ectester/standalone/test/KeyGeneratorTestable.java deleted file mode 100644 index 774c3ec..0000000 --- a/src/cz/crcs/ectester/standalone/test/KeyGeneratorTestable.java +++ /dev/null @@ -1,65 +0,0 @@ -package cz.crcs.ectester.standalone.test; - -import cz.crcs.ectester.common.test.BaseTestable; - -import java.security.InvalidAlgorithmParameterException; -import java.security.KeyPair; -import java.security.KeyPairGenerator; -import java.security.spec.ECParameterSpec; - -/** - * @author Jan Jancar johny@neuromancer.sk - */ -public class KeyGeneratorTestable extends BaseTestable { - private KeyPair kp; - private KeyPairGenerator kpg; - private int keysize = 0; - private ECParameterSpec spec = null; - - public KeyGeneratorTestable(KeyPairGenerator kpg) { - this.kpg = kpg; - } - - public KeyGeneratorTestable(KeyPairGenerator kpg, int keysize) { - this.kpg = kpg; - this.keysize = keysize; - } - - public KeyGeneratorTestable(KeyPairGenerator kpg, ECParameterSpec spec) { - this.kpg = kpg; - this.spec = spec; - } - - public KeyPairGenerator getKpg() { - return kpg; - } - - public KeyPair getKeyPair() { - return kp; - } - - @Override - public void run() { - try { - try { - if (spec != null) { - kpg.initialize(spec); - } else if (keysize != 0) { - kpg.initialize(keysize); - } - } catch (InvalidAlgorithmParameterException e) { - hasRun = true; - ok = false; - return; - } - kp = kpg.genKeyPair(); - ok = true; - - } catch (Exception ex) { - ok = false; - error = true; - errorCause = ex; - } - hasRun = true; - } -} |
