Combining key and certificate into a pkcs12 file

You should be able to run

openssl pkcs12 -export -out certificate.pfx -inkey privkey.pem -in cert.pem -certfile chain.pem

which will prompt you for a password for your pkcs12 file