Skip to content

Commit

Permalink
Add version information.
Browse files Browse the repository at this point in the history
  • Loading branch information
J08nY committed Nov 10, 2017
1 parent 41fab90 commit d2558f0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
6 changes: 6 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,12 @@
<echo message="Packaging ${application.title} into a single JAR at ${store.jar}"/>

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

<copy file="${store.jar}" tofile="${temp.previous_jar}" failonerror="false"/>
<echo message="Backed up ${store.jar} into ${temp.previous_jar}"/>

<delete file="${store.jar}" failonerror="false"/>
<jar destfile="${temp.file}" filesetmanifest="skip">
<zipgroupfileset dir="dist" includes="*.jar"/>
<zipgroupfileset dir="dist/lib" includes="*.jar"/>
Expand All @@ -120,5 +125,6 @@
</zip>

<delete file="${temp.file}"/>
<delete file="${temp.previous_jar}"/>
</target>
</project>
14 changes: 12 additions & 2 deletions src/cz/crcs/ectester/reader/ECTester.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
*
* @author Petr Svenda [email protected]
* @author Jan Jancar [email protected]
* @version v0.1.0
*/
public class ECTester {

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

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

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

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

0 comments on commit d2558f0

Please sign in to comment.