private void generateAssymetricKeyPair(APDU apdu) {
        byte[] buffer = apdu.getBuffer();
        short lc = (short)(buffer[ISO7816.OFFSET_LC] & 0x00FF);
        byte p1 = buffer[ISO7816.OFFSET_P1];
        short len;
        short crt;

        if (buffer[ISO7816.OFFSET_P2] != (byte)0) {
            ISOException.throwIt(ISO7816.SW_WRONG_P1P2);
        }
        len = apdu.setIncomingAndReceive();
        if (lc != (short)2 || lc != len) {
            ISOException.throwIt(ISO7816.SW_WRONG_LENGTH);
        }
        crt = Util.getShort(buffer, ISO7816.OFFSET_CDATA);
        switch (p1) {
            case (byte)0x80:
                if (!chv3.isValidated()) {
                    ISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);
                }
                switch (crt) {
                    case (short)0xb600:
                        keySign.genKeyPair();
                        Util.arrayFillNonAtomic(signCount.getData(), (short)0, (short)3, (byte)0);
                        break;
                    case (short)0xb800:
                        keyDecrypt.genKeyPair();
                        break;
                    case (short)0xa400:
                        keyAuth.genKeyPair();
                        break;
                    default:
                        ISOException.throwIt(ISO7816.SW_DATA_INVALID);
                }
                sendPublicKey(crt, apdu);
                return;
            case (byte)0x81:
                sendPublicKey(crt, apdu);
                return;
            default:
                ISOException.throwIt(ISO7816.SW_WRONG_P1P2);
        }
    }