As far as I know .pfx files are not required to contain both public and private key. However, I could not find a way how to create a file that contains only one of them.
I need this because I am writing a validator for .pfx files and I would like to check if the file contains both private and public key. For testing purposes I would like to create some invalid certificates.