JavacardOS will not accept order any more, please contact our partner Feitian online Store:
https://ftsafe.en.alibaba.com/index.html

Get a CryptoException when creating signature

Algorithm School

Moderator: UNKNwYSHSA

pitbar
Posts: 22
Joined: Wed Dec 02, 2015 5:39 am
Points :93
Contact:

Get a CryptoException when creating signature

Post by pitbar » Mon Feb 29, 2016 1:56 am

I am going to create a signature. But I get a CryptoException with ReasonCode IllegalUse. Could someone tell me what happened? Did I make a mistake?
And here is my code.

Code: Select all

signature = Signature.getInstance(Signature.ALG_RSA_SHA_PKCS1, false);
byte[] mSignature = new byte[20];
byte[] m = {0x01, 0x02, 0x04, 0x05, 0x06, 0x07};
signature.sign(m, (short) 0, (short)m.length, mSignature, (short) 0);

User avatar
horse dream
Posts: 76
Joined: Thu May 21, 2015 11:48 pm
Points :140
Contact:

Re: Get a CryptoException when creating signature

Post by horse dream » Wed Mar 02, 2016 6:15 am

Remember to initialize the signature instance with a signing key.

If convenient, could you post the complete code of your applet?

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 3 guests

JavaCard OS : Disclaimer