diff options
| author | J08nY | 2016-12-10 23:32:41 +0100 |
|---|---|---|
| committer | J08nY | 2016-12-10 23:37:51 +0100 |
| commit | 5f0ec2706a9dbb6aa72ea3c7eb798cd83045e867 (patch) | |
| tree | 36df89a0253469d4cca2de53eb12314ccc58f4cb /src/applets/ECKeyGenerator.java | |
| parent | 31a9da5493cb5085354dbfa034cea4b1d45df3cb (diff) | |
| download | ECTester-5f0ec2706a9dbb6aa72ea3c7eb798cd83045e867.tar.gz ECTester-5f0ec2706a9dbb6aa72ea3c7eb798cd83045e867.tar.zst ECTester-5f0ec2706a9dbb6aa72ea3c7eb798cd83045e867.zip | |
Added CLI options, Apache commons-cli lib, anomalous curve key export
- Added CLI options, see SimpleAPDU.jar -h
- Added Apache commons-cli for CLI options, it uses Apache license
- Added support for anomalous curve export both reader/applet side:
`java -jar SimpleAPDU.jar -g 10 -b 256 -fp -s`
generates 10 curves over ECSP256 an anomalous 256bit curve.
Diffstat (limited to 'src/applets/ECKeyGenerator.java')
| -rw-r--r-- | src/applets/ECKeyGenerator.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/applets/ECKeyGenerator.java b/src/applets/ECKeyGenerator.java index c4b71c0..491cd86 100644 --- a/src/applets/ECKeyGenerator.java +++ b/src/applets/ECKeyGenerator.java @@ -22,7 +22,6 @@ public class ECKeyGenerator { public static final byte KEY_BOTH = KEY_PUBLIC | KEY_PRIVATE; - //TODO: add something like allocateGenerate, or modify allocate to auto-generate a key-pair if it returns null key references after allocating public short allocatePair(byte keyClass, short keyLength) { short result = ISO7816.SW_NO_ERROR; try { @@ -105,6 +104,10 @@ public class ECKeyGenerator { return sw; } + public short setCustomAnomalousCurve(short keyClass, short keyLength, byte[] buffer, short offset) { + return setCustomCurve(EC_Consts.getAnomalousCurve(keyClass, keyLength), buffer, offset); + } + public short setParameter(byte key, short param, byte[] data, short offset, short length) { short result = ISO7816.SW_NO_ERROR; try { |
