PKCS Keystore using KeyTools
To create a keystore of PKCS12 type (.pfx) you have to specify it with -storetype PKCS12:
keytool -genkey -alias {desired alias certificate} -keystore {path to keystore.pfx} -storepass {password} -validity 365 -keyalg RSA -keysize 2048 -storetype pkcs12