return receive(new CommandAPDU(ISO7816_CLA_STD, 0x2a, 0x9e, 0x9a, 256));
}
public boolean verify(int idx, byte[] data, byte[] sig) {
// MANAGE SE (activate inst sig key)
send(new CommandAPDU(ISO7816_CLA_STD, 0x22, 0x41, 0xB6 /*signature*/, new byte[]{
(byte) 0x84, // private key
(byte) 0x01, // length
(byte) (0x81 + idx), // kid
(byte) 0x83, // public key
(byte) 0x01, // length
(byte) (0x91 + idx), // kid
(byte) 0x80, // algorithm
(byte) 0x01, // length
(byte) 0x25 // HBCI
}));
// PUT HASH
send(new CommandAPDU(ISO7816_CLA_STD, 0x2a, 0x90, 0x81, data));
// VERIFY
try {
send(new CommandAPDU(ISO7816_CLA_STD, 0x2a, 0x00, 0xa8, sig));
} catch (HBCI_Exception e) {
return false;
}
return true;
}