Here is section of my apple.
Code: Select all
RSAPrivateKey rsa_PrivateKey;
RSAPublicKey rsa_PublicKey;
KeyPair rsa_KeyPair;
Cipher cipherRSA;
Signature sig;
short expo;
short PIN;
byte[] pinSig = new byte[64];
public short verify (byte[] pin){
sig = Signature.getInstance(Signature.ALG_RSA_SHA_PKCS1, false);
sig.init(rsa_PublicKey, Signature.MODE_VERIFY);
if( sig.verify(pin, (short)0, (short)pin.length, pinSig, (short)0, (short)pinSig.length)){
return 1;
}else{
return 0;
}
}
public void setpinSig( byte[] sig){
pinSig = sig;
}
public void setPIN(short pin){
PIN = pin;
}
public short isPIN(short pin){
if ( pin != PIN )return 0;
return 1;
}
When I called setpinSig method, I got an exception thrown on card. I don't know how to fix this problem.
Could anyone help me out?
checkFieldStore -> Security exception
throw_error(SECURITY_EXCEPTION)