I\'m having problems inserting a new CA certificate with privatekey in the Root certificate store of the localmachine.
This is what happens:
//This
new X509Certificate2(localPFXPath, inputPass, X509KeyStorageFlags.MachineKeySet & X509KeyStorageFlags.PersistKeySet); with the & instead of the | worked for me.