Hello @Advait
I sincerely apologize ,I forgot to mention the steps I have already taken.
In STM32CubeMX, follow these steps to enable RSA support in MbedTLS:
1- Under Middleware, select MbedTLS.
2- Go to the Module tab.
3- Enable the option Show Advanced Parameters.
4- In the search bar, type MBEDTLS_RSA_C.
5- When you find the MBEDTLS_RSA_C option, set it to "Defined" ( select "Defined" from the dropdown).

Then Go to Feature support tab and change the value of MBEDTLS_PKCS1_V15 and MBEDTLS_PKCS1_V21 to defined

Generate and build the code : the rsa.c will be added successfully to your project

I am sorry again
THX
Ghofrane