Git Product home page Git Product logo

ant-javacard's Introduction

1674679905811

Hi there 👋

This is Martin from 🇪🇪 Estonia 🇪🇺. Every now and then I push code to Github, that scratches my own itches (remembering Kerckhoff's principle!).

Most probably you're here because of the "open source javacard software development toolkit" that consists of

🛜 NFC/NDEF and 🔑 FIDO/WebAuthn are topics where you can expect developments in 2024.

There are also historical bits and pieces related to generic smart cards (PC/SC, CCID) and crypto with Java/JavaScript/PKCS#11, and Estonian eID and identity (OpenID etc) in general.

When it comes to Estonian eID, most of what I worked on has been continued by others: @OpenSC (open source PKCS#11 and native platform crypto drivers for smart cards), @web-eid (modern WebExtensions based authentication and signing for desktop browsers) and @open-eid (ages ago I pushed Estonia to publish (most of) it's eID client software as open source)

Feel free to 💬 book a call if you have any questions or ongoing projects in these domains or to 🙏 sponsor my open source work!

News

[Google Open Source Peer Bonus for GlobalPlatformPro]

ant-javacard's People

Contributors

dependabot[bot] avatar j08ny avatar jkowalsk avatar lumag avatar martinpaljak avatar mwalle avatar philipwendland avatar promovicz avatar toporin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ant-javacard's Issues

Build fails with bytecode errors

Tried to build with 1.6, 1.7 and 1.8 JDK's as well as JavaCard SDK 2.1.2, 2.2.1, 2.2.2, 3.0.4. Always with the same error on conversion (OS X 10.11.5):

  error: TestApplet: unhandled bytecode arraylength in clinit method, try a different compiler.
  error: TestApplet:unhandled bytecode i2b in clinit method, try a different compiler.

There is no static initializer in the applet.
Any idea what could be going wrong?

Using with eclipse expects full paths

     <javacard jckit="ext/java_card_kit-2_2_2">
        <cap aid="00:00:00:00" version="3.5" output="applet.cap" classes="tmp">
            <applet class="applet.applet" aid="00:00:00:00"/>
            <import exps="ext/visa_openplatform-2_0" jar="ext/visa_openplatform-2_0/visaop20.jar"/>
        </cap>
     </javacard>

Gives error

[javacard] JavaCard SDK folder ext/java_card_kit-2_2_2 does not exist!
and
[cap] error: export file openplatform.exp of package visa.openplatform not found.

Cap option 'javaversion' produces error

In my usage I am trying to specify java 1.5 as the compiler option. In the documentation, it mentions that javaversion should be an option of the cap tag in the build.xml file.

I have tried setting this at other levels (e.g. at taskdef or javacard), but neither option seems to work. I am sure that I am missing something obvious, but not sure what.

Detect and use JC_HOME

if JC_HOME is set and usable and javacard jckit attribute is missing or not usable, use JC_HOME as JavaCard SDK home folder

Issue with white-space directory in Windows

I got this error while verifying CAP file, but it was successfully compiling the source into CAP file.... 😄

My OS and IDE detail:
-> Windows 10 Enterprise v1607 x64
-> Java Card SDK 2.2.2
-> Eclipse Neon.3
-> Ant-Javacard v1.7 (latest)

My build.xml:
build.xml

My build result:
screenshot

I think there is a problem with whitespace-issue because it only shows C:\Users\Jeffry instead of C:\Users\Jeffry Angtoni...

Compiler option

Getting "unsupported int type of intermediate value, must cast intermediate value to type short or byte". I am able to compile using Java Card 3 Platform Development Kit but not with ant-javacard. The problem looks like related to compiler cmd parameters. The class files generated by Java Card 3 Platform Development Kit are different in size(applet.class is 34kb from jcde and 21kb from ant-javacard) compared to ant-javacard. Is there a document pointing to recommended JAVAC cmd parameters.

Header.cap component does not include package name

When building a cap everything works fine with JCDK 3.0.3 that I'm testing but the generated Header.cap component does not include a name (The package_name_info from the CAP file format specification has length 0). I see the same behavior if I use the regular ant tools so probably it is related to the internal converter but I wonder if is worth trying to fix that in this project. If so, I can have a look if someone can provide some guidance where to look to fix that.

Feature Request : Cap to IJC

We can include feature which can Convert Cap to IJC file to be loaded onto card. As IJC is much lighter version to be used on real card.
I have complete the code to convert cap to ijc, If you are okay we can integrate with current code.

Broken latest release

Using the ant-javacard jar to build our CAP files, it now generates a lot of different errors and doesn't compile the cap. But everything is OK when using the previous version.

I spent some time to figure out what's wrong, and ultimately using the previous version, it works well, as before.

I use JDK 8 (1.8.0).

With jckit/targetkit = 3.0.5u4/3.0.5u4, I got something like that :

...
  [convert] [ INFO: ] conversion completed with 0 errors and 1 warnings.
   [verify] Verification passed

BUILD FAILED
build.xml:6: java.lang.UnsupportedOperationException
        at com.sun.nio.zipfs.ZipPath.toFile(ZipPath.java:660)
        at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
        at java.util.ArrayList.forEach(ArrayList.java:1259)
        at java.util.stream.SortedOps$RefSortingSink.end(SortedOps.java:390)
        at java.util.stream.Sink$ChainedReference.end(Sink.java:258)
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:483)
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
        at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
        at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
        at pro.javacard.capfile.CAPFile.strip(CAPFile.java:435)
        at pro.javacard.ant.JavaCard$JCCap.execute(JavaCard.java:795)
        at pro.javacard.ant.JavaCard.execute(JavaCard.java:152)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:299)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
        at org.apache.tools.ant.Task.perform(Task.java:350)
        at org.apache.tools.ant.Target.execute(Target.java:449)
        at org.apache.tools.ant.Target.performTasks(Target.java:470)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1401)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1374)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1264)
        at org.apache.tools.ant.Main.runBuild(Main.java:818)
        at org.apache.tools.ant.Main.startAnt(Main.java:223)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)

With jckit/targetkit = 3.10r20210706/3.0.5u4, I get that :

...
  [convert] [ INFO: ] Converter [v3.1.0]warning: You did not supply export file for the previous minor version of the package
  [convert]
  [convert] [ INFO: ]     Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved.
  [convert]
  [convert]
  [convert] [ INFO: ] conversion completed with 0 errors and 1 warnings.

BUILD FAILED

When using v21.12.31, everything works fine, our cap is compiled and verified in both cases.
That suggests there are some regressions in the 23.04.03 latest release.

-exportpath is not properly set in converter for external jars

I have two jar files with .exp files (USIM.jar and uicc.jar) to build an USIM applet.
This is the snippet of my build.xml

    <javacard>
      <cap jckit="ext/ant/sdks/jc305u3_kit"
           aid="f2:76:a2:88:bc:fb:a6:9d:34:f3:10"
           output="build/UsimApplet.cap"
           sources="src"
           classes="build"
           version="1.0">
        <applet class="UsimApplet" aid="f2:76:a2:88:bc:fb:a6:9d:34:f3:10:01"/>
        <import jar="USIM-API.jar:uicc.jar"/>
      </cap>
    </javacard>

It compiles OK. But converter fails unless I explicitly extract .exp files from above jars and put them in a directory and define import target with both jar and exps attributes.

error: unsupported class file format of version 52.0.

Hi

I am using JDK 8 and javac -1.8. I also tried with JDK 11
I try to convert the file to a .CAP file but every time I run ant I receive the following error : error: unsupported class file format of version 52.0.
Here is a snippet of my error :
image
Also, here is a snippet of my build.xml. I tried several versions of the SDK.
image

Thank you!

Offcardverifier doesn't seems to be run on javacard sdk 2.2.2

While testing the javacardos jcide, I got an error when building my applet:
com.sun.javacard.offcardverifier.bf: the number of interface for the class or interface XXX is incoherent with the number of the same class or same interface than the class component.

I was able to trigger the problem by not inheriting an interface.
Not OK:
public class MyPIN extends OwnerPIN {
OK:
public class MyPIN extends OwnerPIN implements PIN {

But when built under ant-javacard, no error is shown.
=> is ant-javacard really runing offcardverifier like the sdk built ?

install LibraryUser_01020304050607_JCv2.2.2.cap

How do you install "LibraryUser_01020304050607_JCv2.2.2.cap"?

If I install the cap file directly, I get:
LOAD failed: 0x6438

So I tried to install "testapplets.library.cap" first (which works), then install the "LibraryUser_01020304050607_JCv2.2.2.cap", I get:
CAP loaded
INSTALL [for install and make selectable] failed: 0x6985 (Conditions of use not satisfied)

thanks!

StringPool & StringDef not working as expected

It looks like classes generated with the StringPool and StringDef annotations aren't reachable from the annotated class, and tests don't cover this “edge” case:

@StringPool(value = {
@StringDef(name = "hello", value = "Hello World!"),
},
name = "HelloWorldString")

If the stringdefs test case included a call to HelloWorldString.importLibConstants or tried to access any of the created fields from the applet's class constructor, the build process would fail:

Buildfile: /···/build.xml

clean:
   [delete] Deleting directory /···/build

jcpro:
    [mkdir] Created dir: /···/build
    [javac] Compiling 2 source files to /···/build

···:
      [cap] INFO: using JavaCard 3.1.0 SDK in /···/sdks/jc310r20210706_kit
      [cap] INFO: Setting package name to testapplets.stringdefs
      [cap] Building CAP with 1 applet from package testapplets.stringdefs (AID: 0102030405)
      [cap] testapplets.stringdefs.Empty 010203040506
  [compile] Compiling files from /···/src/testapplets/stringdefs
  [compile] Compiling 1 source file to /···
  [compile] /···/src/testapplets/stringdefs/Empty.java
  [compile] /···/src/testapplets/stringdefs/Empty.java:18: error: cannot find symbol
  [compile] 		HelloWorldString.importLibConstants();
  [compile] 		^
  [compile]   symbol:   variable HelloWorldString
  [compile]   location: class Empty
  [compile] 1 error

BUILD FAILED
/···: Compile failed; see the compiler error output for details.

Total time: 1 second

Build process leaves temporary directory in place

Ant doesn't support removing temporary directories recursively, so after building the ant-javacard, the temorary directory still exists:

dist:
      [jar] Building jar: /home/lumag/Projects/JC/ant-javacard/ant-javacard.jar

BUILD SUCCESSFUL
Total time: 1 second
[pid 29960] unlink("/tmp/jcpro1902514858") = -1 EISDIR (Is a directory)
[pid 29960] rmdir("/tmp/jcpro1902514858") = -1 ENOTEMPTY (Directory not empty)

and

$ ls -ld /tmp/jcpro1902514858/
drwxr-xr-x 3 lumag lumag 4096 июл 30 15:30 /tmp/jcpro1902514858/

Export file saved to tmp folder

I have defined export="${project.basedir}/bin/export for the cap task, but the export files are not generated there. I have already deleted the folder, but the problem persists under Ubuntu 22.04.

Take not of /tmp/jccpro15000839968602750102/com/example/foo/javacard/foo.exp

[INFO] [verify] Verification passed
[INFO] [cap] CAP saved to /home/foobar/Projekte/foo/my-lib-dev/bin/my-lib.cap
[INFO] [exp] EXP saved to /tmp/jccpro15000839968602750102/com/example/foo/javacard/foo.exp
[INFO] [jar] Building jar: /home/foobar/Projekte/foo/my-lib-dev/bin/export/foo.jar
[INFO] [jar] JAR saved to /home/foobar/Projekte/foo/my-lib-dev/bin/export/foo.jar
[INFO] Executed tasks

ant-javacard.jar, build fails with NullPointerException

Hello Mr. Paljak,

I stumbled upon a problem that seems to be located in ant-javacard.jar. Unfortunately I am not an expert in Java/ANT, but I hope you find the following helpful anyway.

For testing I am using the HelloSTK2 from Merlin Chlosta
git clone https://github.com/mrlnc/HelloSTK2.git

When I leave everything unchanged (except running "git submodule update --init --recursive" beforehand to get the javacard SDKs) and use the latest ant-javacard.jar ANT task (see also build.xml), I get the following:

$ ant
Buildfile: /home/owner/HelloSTK2/build.xml

dist:
      [get] Getting: https://github.com/martinpaljak/ant-javacard/releases/latest/download/ant-javacard.jar
      [get] To: /home/owner/HelloSTK2/ant-javacard.jar
      [get] https://github.com/martinpaljak/ant-javacard/releases/latest/download/ant-javacard.jar moved to https://github.com/martinpaljak/ant-javacard/releases/download/v23.08.07/ant-javacard.jar
      [get] https://github.com/martinpaljak/ant-javacard/releases/download/v23.08.07/ant-javacard.jar moved to https://objects.githubusercontent.com/github-production-release-asset-2e65be/28853876/cf98fb4e-341f-4a96-a4fb-56246e22817a?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230825%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230825T153506Z&X-Amz-Expires=300&X-Amz-Signature=25085afbcd6e3189cb3308202a904a700f5895078197919bb55517cabb50328a&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=28853876&response-content-disposition=attachment%3B%20filename%3Dant-javacard.jar&response-content-type=application%2Foctet-stream

BUILD FAILED
/home/owner/HelloSTK2/build.xml:9: java.lang.NullPointerException
	at pro.javacard.ant.JavaCard$JCCap.setTargetsdk(JavaCard.java:303)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.apache.tools.ant.IntrospectionHelper$AttributeSetter.setObject(IntrospectionHelper.java:1488)
	at org.apache.tools.ant.IntrospectionHelper.setAttribute(IntrospectionHelper.java:406)
	at org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfigurable.java:527)
	at org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfigurable.java:463)
	at org.apache.tools.ant.UnknownElement.handleChild(UnknownElement.java:588)
	at org.apache.tools.ant.UnknownElement.handleChildren(UnknownElement.java:357)
	at org.apache.tools.ant.UnknownElement.configure(UnknownElement.java:206)
	at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:165)
	at org.apache.tools.ant.Task.perform(Task.java:349)
	at org.apache.tools.ant.Target.execute(Target.java:449)
	at org.apache.tools.ant.Target.performTasks(Target.java:470)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1388)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1361)
	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
	at org.apache.tools.ant.Main.runBuild(Main.java:834)
	at org.apache.tools.ant.Main.startAnt(Main.java:223)
	at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284)
	at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)

Total time: 1 second

when I use the ant-javacard.jar v21.12.31 [1], then everything is built without problems.

$ ant
Buildfile: /home/owner/HelloSTK2/build.xml

dist:
      [get] Destination already exists (skipping): /home/owner/HelloSTK2/ant-javacard.jar
      [cap] INFO: using JavaCard 3.0.5 SDK in /home/owner/HelloSTK2/oracle_javacard_sdks/jc305u3_kit
      [cap] INFO: targeting JavaCard 2.2.1 SDK in /home/owner/HelloSTK2/oracle_javacard_sdks/jc221_kit
      [cap] INFO: Setting package name to com.github.mrlnc.HelloSTK2
      [cap] Building CAP with 1 applet from package com.github.mrlnc.HelloSTK2 (AID: D07002CA44)
      [cap] com.github.mrlnc.HelloSTK2.HelloSTK2 D07002CA44900101
  [compile] Compiling files from /home/owner/HelloSTK2/src
  [compile] Compiling 1 source file to /home/owner/HelloSTK2/bin
  [compile] /home/owner/HelloSTK2/src/com/github/mrlnc/hellostk2/HelloSTK2.java
  [convert] [ INFO: ] Converter [v3.0.5]
  [convert] [ INFO: ]     Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
  [convert]     
  [convert]     
  [convert] [ INFO: ] conversion completed with 0 errors and 0 warnings.
   [verify] Verification passed
      [cap] CAP saved to /home/owner/HelloSTK2/bin/HelloSTK2.cap

BUILD SUCCESSFUL
Total time: 2 seconds

[1] https://github.com/martinpaljak/ant-javacard/releases/download/v21.12.31/ant-javacard.jar

Best regards.
Philipp Maier

Feature request: support for reproducible builds

Currently the Sun/Oracle CAP generator inserts a timestamp in the CAP-file manifest that makes builds non-reproducible.

It should be possible to fix this in a generic and reusable manner by re-generating the JAR with this attribute squashed.

Apart from this little issue the tools involved seem to behave reproducibly already.

Java Compiler Compliance option missing

For reference: #26 (comment)
First of all, I am new to JavaCards and not experienced with java build tools, so far.

"Java Compiler Compliance" is used to compile for a JVM, which does not support the recent class file format, right? https://stackoverflow.com/questions/22584427/what-is-compiler-compliance-level-in-eclipse

Real cards or a simulator may have a compliance level lower than the compiler, but we have to make sure it runs properly.

Sometimes the JCOP tools have hard time compiling/producing your applets (everything works fine, but the CAP file is not produced and cannot be uploaded to the card). The Java language compatibility needs to be set up properly for the Java Card project. In project properties in Eclipse chose "Java compiler" and set "Compiler compliance level" to 1.3 (this should be the safest).

Source: https://www.cs.ru.nl/E.Poll/hw/practical.html

I found similar configuration in this gradle build file. github-af/SmartPGP@9955dd9

Why do you think this option is obsolete?

Class files copied into cap file at wrong location

When creating a cap file from classes, then class files are copied into the cap to the wrong location.

<!-- Extract class files for biometry interface and create .cap file -->
<unjar src="${basedir}/${jcsdk}/lib/api_classic.jar" dest="${class.folder}">
    <patternset>
        <include name="javacardx/biometry/*.class" />
    </patternset>
</unjar>

<javacard jckit="${jcsdk}">
    <cap aid="A0000000620202" package="javacardx.biometry" classes="${class.folder}" output="${release.folder}/biometry.cap" version="1.3" verify="false" />
</javacard>

creates a cap file with

Archive:  biometry.cap
  Length      Date    Time    Name
---------  ---------- -----   ----
      808  2021-02-22 17:42   META-INF/MANIFEST.MF
       20  2021-02-22 17:42   javacardx/biometry/javacard/Header.cap
       34  2021-02-22 17:42   javacardx/biometry/javacard/Directory.cap
       24  2021-02-22 17:42   javacardx/biometry/javacard/Import.cap
       13  2021-02-22 17:42   javacardx/biometry/javacard/ConstantPool.cap
       32  2021-02-22 17:42   javacardx/biometry/javacard/Class.cap
       30  2021-02-22 17:42   javacardx/biometry/javacard/Method.cap
       13  2021-02-22 17:42   javacardx/biometry/javacard/StaticField.cap
        9  2021-02-22 17:42   javacardx/biometry/javacard/RefLocation.cap
       32  2021-02-22 17:42   javacardx/biometry/javacard/Export.cap
      521  2021-02-22 17:42   javacardx/biometry/javacard/Descriptor.cap
      535  2021-02-22 17:42   META-INF/javacard.xml
     1108  2021-02-22 17:42   javacardx/biometry/BioBuilder.class
      448  2021-02-22 17:42   javacardx/biometry/BioException.class
      529  2021-02-22 17:42   javacardx/biometry/BioTemplate.class
      325  2021-02-22 17:42   javacardx/biometry/OwnerBioTemplate.class
      162  2021-02-22 17:42   javacardx/biometry/SharedBioTemplate.class
---------                     -------
     4643                     17 files

If stored in the cap, class files should be located in APPLET-INF/classes

Unable to get excludes attribute to work

Hello,

I have a modified version of PivApplet that I am trying to add JUnit tests to. I have some test code that's not intended to be part of the .cap, and I'm trying to exclude it using the excludes attribute.

    <javacard>
      <cap aid="a0:00:00:03:08:00:00:10" output="bin/PivApplet.cap" sources="src-gen" excludes="**Test**" classes="bin" version="1.0">
        <applet class="net.cooperi.pivapplet.PivApplet" aid="a0:00:00:03:08:00:00:10:00:01:00"/>
      </cap>
    </javacard>

I've tried every variation I can come up with in order to exclude "src-gen/org/openphysical/pivapplet/PivAppletTest.java". I've tried **Test**, **/*Test.java, etc. I've even tried excluding ".class", ".java", etc. just to see if it would exclude other files.

Does the excludes attribute work? It's entirely possible I'm using it wrong.

error on static array initialization in package

I have the following toy code for a library package with a static array:

package testapplets.library;
import javacard.security.RandomData;

public class SomeLibrary {
	public static final short TRUE = (short) 0x5AA5;
	public static final short FALSE = (short) 0xA55A;

	public static final byte[] test = { 'a', 'b', 'c'};

	public static short booleantest(boolean b) {
	        return b ? TRUE : FALSE;
	}

	public static RandomData getRandom() {
		return RandomData.getInstance(RandomData.ALG_SECURE_RANDOM);
	}
}

and the following ant task to build the library package:

  <target name="libtest" depends="prepare">
    <javacard jckit="${converter.sdk}">
      <cap targetsdk="${target.sdk}" sources="src/library" package="testapplets.library" aid="11:22:33:44:55" export="lib" output="build/libtest.cap" version="1.0"/>
    </javacard>
  </target>

but I am getting the following error message:

  [convert] [ INFO: ] Converter [v3.1.0]
  [convert] [ INFO: ]     Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
  [convert]     
  [convert]     
  [convert] [ INFO: ] conversion completed with 1 errors and 0 warnings.
  [convert] error:  Static array initialization in class testapplets/library/SomeLibrary in library package not allowed.

Why is static array in a library problematic? builds fine if I remove the static array

Maven artifact

Hello,

have you considered uploading this to the maven central repository?

It would be great!

Thanks

Add support for JC 3.2

  • While the last supported JDK version is 17, make sure the java code also cleanly compiles with JDK 21.

Don't show "int" warning when "ints=true"

Hello,

Is it possible to hide these warnings when the build.xml explicitely contains ints=true ?

[cap] warning: line 34: offlinewallet.Utils: int type of local variable.
[cap] warning: line 35: offlinewallet.Utils: int type of local variable.
[cap] warning: line 36: offlinewallet.Utils: int type of local variable.
[cap] warning: line 37: offlinewallet.Utils: int type of local variable.
[cap] warning: This package requires int support.

Error when importing multiple package with the same path

Hello,

I got an error when using multiple imports with the same folderpath.

I did some modifications to source code to support it. I tried to do a branch to push my modifications but I don't have the rights. Is there a prefered way to share modifications ?

Cheers and thanks for this wonderful project that saved me hours of coding ;-)

Add to docs instructions for OSX

brew tap caskroom/versions
brew cask install java8
brew install [email protected]

export PATH="/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/bin:$PATH"
export PATH="/usr/local/opt/[email protected]/bin:$PATH"
export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home"

Which JavaCard SDK version to use?

Hello,

I have some JavaCard running on version 2.2 and 2.3. What is the best practive ? I have to use the SDK 305u1 or the 222 ? Both running on my cards, but the CAP file is twice bigger with the 305u1 (12kB against 5kB).

Is new version is more secure and fix issue ?

Sincerly.

invalid AID 1.0.

I am trying to use the ant-javacard and every time I run it I receive the following error: invalid AID 1.0. ( or whatever version I am specifying ) .

Here is a snippet of my build.xml

image

Could you please point me in the right direction regarding the AID problem? Thank you!

document private maven repo

Hi,

I am using your libs and would like to bump to the v20 but they are not released in the maven central yet. Do you pls plan to submit it there?

Thanks!

java 8 - lambda expression is unsupported

Settings:

  <get src="https://github.com/martinpaljak/ant-javacard/releases/latest/download/ant-javacard.jar" dest="./build" skipexisting="true"/>
  <taskdef name="javacard" classname="pro.javacard.ant.JavaCard" classpath="./build/ant-javacard.jar"/>
  
  <target name="applet_build" description="Generate the JC applet binaries.">
    <echo message ="Building the the project to JC applet package."/>
    <javacard jckit="./sdks/jc305u4_kit">
     <cap targetsdk="./sdks/jc222_kit" ...>
....

Seems like the library doesn't support lambda expression.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.