Hi Stefano,
The pk module has limited support for opaque RSA keys, by using the RSA_ALT functionality (https://tls.mbed.org/kb/cryptography/use-external-rsa-private-key https://tls.mbed.org/kb/cryptography/use-external-rsa-private-key). There's no support for opaque EC keys.
For a TLS server, you can use the asynchronous callback feature to use an opaque key. See https://tls.mbed.org/kb/how-to/ssl_async https://tls.mbed.org/kb/how-to/ssl_async
The PSA crypto API supports opaque keys. On the application side, you need to use functions like psa_asymmetric_sign instead of mbedtls_pk_sign. On the hardware side, you need to implement a secure element driver for your crypto chip. Driver support is work in progress, and documentation and tooling are still sparse. The driver specifications are in https://github.com/ARMmbed/mbedtls/tree/development/docs/proposed https://github.com/ARMmbed/mbedtls/tree/development/docs/proposed . To add driver support, you currently need to edit library/psa_crypto_driver_wrappers.c and replace calls to the test driver by calls to your real driver.
Best regards,
mbed-tls@lists.trustedfirmware.org