Get a CryptoException when creating signature
Posted: 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.
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);