Exports the current System.Security.Cryptography.X509Certificates.X509Certificate object to a byte array in a format described by one of the System.Security.Cryptography.X509Certificates.X509ContentType values.
- contentType
- One of the System.Security.Cryptography.X509Certificates.X509ContentType values that describes how to format the output data.
An array of bytes that represents the current System.Security.Cryptography.X509Certificates.X509Certificate object.
The contentType parameter accepts only the following values of the System.Security.Cryptography.X509Certificates.X509ContentType enumeration: X509ContentType.Cert, X509ContentType.SerializedCert, and X509ContentType.Pkcs12. Passing any other value causes a System.Security.Cryptography.CryptographicException to be thrown.