martinpaljak / GlobalPlatformPro

🌐 🔐 Manage applets and keys on JavaCard-s like a pro (via command line or from your Java project)
https://javacard.pro/globalplatform
GNU Lesser General Public License v3.0
673 stars 210 forks source link

CLI 'put-key' option gives error with joptsimple.OptionArgumentConversionException error #294

Open gwachob opened 2 years ago

gwachob commented 2 years ago

On HEAD (starting around e27d37f5487264524f5a966df7743572bff66f8b I thinik), the put-key option seems broken.

Any invocation (java -jar gp.jar) seems to result in something like the following stack trace (tried with JDK 8, JDK 11):

Error: Cannot parse argument 'keys/dap.pem' of option put-key
joptsimple.OptionArgumentConversionException: Cannot parse argument 'keys/dap.pem' of option put-key
    at joptsimple.AbstractOptionSpec.convertWith(AbstractOptionSpec.java:92)
    at joptsimple.ArgumentAcceptingOptionSpec.convert(ArgumentAcceptingOptionSpec.java:277)
    at joptsimple.OptionSet.valuesOf(OptionSet.java:223)
    at joptsimple.OptionSet.valueOf(OptionSet.java:172)
    at pro.javacard.gp.GPTool.run(GPTool.java:435)
    at pro.javacard.gp.GPTool.main(GPTool.java:148)
Caused by: joptsimple.internal.ReflectionException: java.lang.IllegalAccessException: class joptsimple.internal.Reflection cannot access a member of class pro.javacard.gp.Key with modifiers "public static"
    at joptsimple.internal.Reflection.reflectionException(Reflection.java:140)
    at joptsimple.internal.Reflection.invoke(Reflection.java:118)
    at joptsimple.internal.MethodInvokingValueConverter.convert(MethodInvokingValueConverter.java:48)
    at joptsimple.internal.Reflection.convertWith(Reflection.java:124)
    at joptsimple.AbstractOptionSpec.convertWith(AbstractOptionSpec.java:90)
    ... 5 more
Caused by: java.lang.IllegalAccessException: class joptsimple.internal.Reflection cannot access a member of class pro.javacard.gp.Key with modifiers "public static"
gwachob commented 2 years ago

I'm not the only one seeing this issue, right?

martinpaljak commented 1 year ago

Can you replicate this with "next" branch?