https://learn.microsoft.com/en-us/dotnet/api/system.security.cryptography.x509certificates.x509certificate2.getcertcontenttype?view=net-8.0
This function throws CryptographicException (undocumented) when the input isn't parsable as any of the supported cryptographic input types.