I got this exception while trying to create a new instance of the X509Certificate2—to have a public certificate in-memory. Obviously, the error message was not that helpful.
It turns out that the content of the byte I passed into the constructor was not correct. It was only the actual public-key (cert.PublicKey.RawData), and the rest of the public-key-cert (cert.RawData) was missing (e.g. name, expiration date).
I have no doubt other conditions could cause this exception, but this could be what you're looking for :-)