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);