Skip to content

Commit d2558f0

Browse files
committed
Add version information.
1 parent 41fab90 commit d2558f0

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

build.xml

+6
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,12 @@
104104
<echo message="Packaging ${application.title} into a single JAR at ${store.jar}"/>
105105

106106
<tempfile property="temp.file" destDir="${java.io.tmpdir}" suffix=".jar"/>
107+
<tempfile property="temp.previous_jar" destdir="${java.io.tmpdir}" suffix=".jar"/>
107108

109+
<copy file="${store.jar}" tofile="${temp.previous_jar}" failonerror="false"/>
110+
<echo message="Backed up ${store.jar} into ${temp.previous_jar}"/>
111+
112+
<delete file="${store.jar}" failonerror="false"/>
108113
<jar destfile="${temp.file}" filesetmanifest="skip">
109114
<zipgroupfileset dir="dist" includes="*.jar"/>
110115
<zipgroupfileset dir="dist/lib" includes="*.jar"/>
@@ -120,5 +125,6 @@
120125
</zip>
121126

122127
<delete file="${temp.file}"/>
128+
<delete file="${temp.previous_jar}"/>
123129
</target>
124130
</project>

src/cz/crcs/ectester/reader/ECTester.java

+12-2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
*
4848
* @author Petr Svenda [email protected]
4949
* @author Jan Jancar [email protected]
50+
* @version v0.1.0
5051
*/
5152
public class ECTester {
5253

@@ -58,8 +59,11 @@ public class ECTester {
5859
private Config cfg;
5960

6061
private Options opts = new Options();
61-
private static final String CLI_HEADER = "\nECTester, a javacard Elliptic Curve Cryptograhy support tester/utility.\n\n";
62-
private static final String CLI_FOOTER = "\nMIT Licensed\nCopyright (c) 2016-2017 Petr Svenda <[email protected]>";
62+
private static final String VERSION = "v0.1.0";
63+
private static final String DESCRIPTION = "ECTester " + VERSION + ", a javacard Elliptic Curve Cryptograhy support tester/utility.";
64+
private static final String LICENSE = "MIT Licensed\nCopyright (c) 2016-2017 Petr Svenda <[email protected]>";
65+
private static final String CLI_HEADER = "\n" + DESCRIPTION + "\n\n";
66+
private static final String CLI_FOOTER = "\n" + LICENSE;
6367

6468
private static final byte[] SELECT_ECTESTERAPPLET = {(byte) 0x00, (byte) 0xa4, (byte) 0x04, (byte) 0x00, (byte) 0x0a,
6569
(byte) 0x45, (byte) 0x43, (byte) 0x54, (byte) 0x65, (byte) 0x73, (byte) 0x74, (byte) 0x65, (byte) 0x72, (byte) 0x30, (byte) 0x31};
@@ -74,6 +78,10 @@ private void run(String[] args) {
7478
if (cli.hasOption("help")) {
7579
help();
7680
return;
81+
} else if (cli.hasOption("version")) {
82+
System.out.println(DESCRIPTION);
83+
System.out.println(LICENSE);
84+
return;
7785
}
7886
cfg = new Config();
7987

@@ -200,6 +208,7 @@ private void run(String[] args) {
200208
private CommandLine parseArgs(String[] args) throws ParseException {
201209
/*
202210
* Actions:
211+
* -V / --version
203212
* -h / --help
204213
* -e / --export
205214
* -g / --generate [amount]
@@ -242,6 +251,7 @@ private CommandLine parseArgs(String[] args) throws ParseException {
242251
*/
243252
OptionGroup actions = new OptionGroup();
244253
actions.setRequired(true);
254+
actions.addOption(Option.builder("V").longOpt("version").desc("Print version info.").build());
245255
actions.addOption(Option.builder("h").longOpt("help").desc("Print help.").build());
246256
actions.addOption(Option.builder("ln").longOpt("list-named").desc("Print the list of supported named curves and keys.").hasArg().argName("what").optionalArg(true).build());
247257
actions.addOption(Option.builder("e").longOpt("export").desc("Export the defaut curve parameters of the card(if any).").build());

0 commit comments

Comments
 (0)