I\'m trying to create a .p12 file that does not contain a valid identity (public key / private key pair) in order to test my app\'s certificate import functionality. Is it p
There is a very handy GUI tool written in java called portecle which you can use for creation of an empty PKCS#12 keystore and also for an import of the certificate without the private key into the PKCS#12 keystore - this functionality is available under "Import trusted certificate (Ctrl-T)" button.
However if you insist on using OpenSSL you can use this command:
openssl pkcs12 -export -nokeys -in certificate.cer -out pkcs12.pfx