Fixes for the PTEID card

Hello,

The attached commits fix an issue with the PKCS#15 emulation layer for the PTEID card and simplify the compute signature operation.