Install JDK on your machine.
In JDK files navigate to bin folder and copy it's path. ex: C:\Program Files\Java\jdk-17\bin
Open command prompt window.
run the command :
cd C:\Program Files\Java\jdk-17\bin
run the command :
keytool -export -rfc -keystore D:\Users\Documents\AppAndriod\app\keystore\certificate.jks -alias my_alias -file D:\Users\Documents\AppAndriod\app\keystore\certificate.pem
Enter your key's password in the command prompt.
Your .pem key will be generated successfully.
Note that :