Hello,
The key and algo references are both only 1 byte long.
So the LC byte (Length of subsequent data field) is '05'
"0x04 as Length of following data" means 4 bytes will follow
You can find a good example in the minidriver here:
https://github.com/Fedict/eid-mw/blob/master/cardcomm/minidriver/src/SmartCard.c#L755C7-L755C14 /* Prepare SET COMMAND before a VERIFY PIN */
Cmd [0] = 0x00;
Cmd [1] = 0x22; /* MSE: SET COMMAND */
Cmd [2] = 0x41;
Cmd [3] = 0xB6;
Cmd [4] = 0x05;
Cmd [5] = 0x04; /* Length of following data */
Cmd [6] = 0x80; /* ALGO Rreference */
Cmd [7] = bAlgo;//0x01; /* RSA PKCS#1 */
Cmd [8] = 0x84; /* TAG for private key reference */
Cmd [9] = bKey; /*0x82 for AUTH, 0x83 for NONREP*/
Wkr,
Frederik