AlessioScarfone / Java-Digital-Signature

Java command line tool for digital signature with PKCS#11 token.
GNU General Public License v3.0
34 stars 13 forks source link

Utilizzo sul Mac #1

Open forlando952 opened 4 years ago

forlando952 commented 4 years ago

Salve anzitutto complimenti per il software. Volevo segnalare che su Mac Os Catilina, utilizzando Token Usb Key4-c ed eseguendo tutte le istruzioni mi da il seguente errore Exception in thread "main" java.lang.reflect.InvocationTargetException 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.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:61) Caused by: java.lang.NoSuchMethodError: sun.security.pkcs11.SunPKCS11.(Ljava/io/InputStream;)V at eu.europa.esig.dss.token.Pkcs11SignatureToken.installProvider(Pkcs11SignatureToken.java:154) at eu.europa.esig.dss.token.Pkcs11SignatureToken.getProvider(Pkcs11SignatureToken.java:130) at eu.europa.esig.dss.token.Pkcs11SignatureToken.getKeyStore(Pkcs11SignatureToken.java:174) at eu.europa.esig.dss.token.AbstractKeyStoreTokenConnection.getKeys(AbstractKeyStoreTokenConnection.java:24) at com.unical.digitalsignature.Main.sign(Main.java:191) at com.unical.digitalsignature.Main.main(Main.java:113) ... 5 more

miguelius commented 4 years ago

Since Java9 SunPKCS11 constructor doesn't accept the input stream anymore.

Check the java release and if you are using a release newer than 8 you should refactor Pkcs11SignatureToken.

On Mon, Apr 20, 2020 at 2:13 PM forlando952 notifications@github.com wrote:

Salve anzitutto complimenti per il software. Volevo segnalare che su Mac Os Catilina, utilizzando Token Usb Key4-c ed eseguendo tutte le istruzioni mi da il seguente errore Exception in thread "main" java.lang.reflect.InvocationTargetException 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.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:61) Caused by: java.lang.NoSuchMethodError: sun.security.pkcs11.SunPKCS11.(Ljava/io/InputStream;)V at eu.europa.esig.dss.token.Pkcs11SignatureToken.installProvider(Pkcs11SignatureToken.java:154) at eu.europa.esig.dss.token.Pkcs11SignatureToken.getProvider(Pkcs11SignatureToken.java:130) at eu.europa.esig.dss.token.Pkcs11SignatureToken.getKeyStore(Pkcs11SignatureToken.java:174) at eu.europa.esig.dss.token.AbstractKeyStoreTokenConnection.getKeys(AbstractKeyStoreTokenConnection.java:24) at com.unical.digitalsignature.Main.sign(Main.java:191) at com.unical.digitalsignature.Main.main(Main.java:113) ... 5 more

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/AlessioScarfone/Java-Digital-Signature/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABDB5CGU6EY7S2HFAWBAVLLRNR7DFANCNFSM4MMTXGYQ .

forlando952 commented 4 years ago

I have Java 8 update 251

-- Pisanina Hockins

On 20 aprile 2020 a 19:36:09, Miguel Carboni (notifications@github.com) scritto:

Since Java9 SunPKCS11 constructor doesn't accept the input stream anymore.

Check the java release and if you are using a release newer than 8 you should refactor Pkcs11SignatureToken.

AlessioScarfone commented 4 years ago

Hi, I used Java 8 update 181.

I think @miguelius's suggestion is correct (Thanks @miguelius for your comment). So you can try with an older version of Java or a refactor.

miguelius commented 4 years ago

It's a guess... rather outrageous... But it looks like the library is beeing called from an app running in a different java runtime than the one mentioned above

miguelius commented 4 years ago

digidoc4j should be updated for a release supporting java9+