troubles to sign with new e-token.

182 views
Skip to first unread message

Sebastian Porflit

unread,
Oct 25, 2023, 2:48:09 PM10/25/23
to JSignPdf
Hi everyone!

I have a little script to sign files using windows CLI. and I have a e-token connected with.
I can sign any file without troubles, till today.

I have to sign files with a different e-token and have a error message that I don't understand how to resolve.
this is the line to sing :

java -jar JSignPdf.jar -kst PKCS11 -ksp <password> -ha "SHA1" -V --l2-text "Firmado digitalmente por: "${signer}",  Firmado el "${timestamp} -os "_firmado" -pg "1" -fs "12.0"  --bg-path "'.$background_sign_image.'" '.$file_to_sign.' -cl "NOT_CERTIFIED" -d '.$result_path

And this is the message I get.

java.security.ProviderException: sun.security.pkcs11.wrapper.PKCS11Exception: CKR_FUNCTION_FAILED java.security.ProviderException: sun.security.pkcs11.wrapper.PKCS11Exception: CKR_FUNCTION_FAILED [31] => at jdk.crypto.cryptoki/sun.security.pkcs11.P11Signature.engineSign(Unknown Source) [32] => at java.base/java.security.Signature$Delegate.engineSign(Unknown Source) [33] => at java.base/java.security.Signature.sign(Unknown Source) [34] => at com.lowagie.text.pdf.PdfPKCS7.getEncodedPKCS7(PdfPKCS7.java:1261) [35] => at net.sf.jsignpdf.SignerLogic.signFile(SignerLogic.java:425) [36] => at net.sf.jsignpdf.Signer.signFiles(Signer.java:246) [37] => at net.sf.jsignpdf.Signer.main(Signer.java:139) [38] => Caused by: sun.security.pkcs11.wrapper.PKCS11Exception: CKR_FUNCTION_FAILED [39] => at jdk.crypto.cryptoki/sun.security.pkcs11.wrapper.PKCS11.C_Sign(Native Method)


Never seen before today.

Any piece of advice that you can provide to me, will be appreciated
thanks in advance!.



Θεόφιλος Ιντζόγλου

unread,
Oct 26, 2023, 3:56:31 AM10/26/23
to jsig...@googlegroups.com
New e-tokens usually don’t support SHA1. Try to use SHA256.

--
() ascii ribbon campaign - against html mail
/\ - against microsoft attachments



Reply all
Reply to author
Forward
0 new messages