toX5c
Encodes the certificate chain as JSON Array according to RFC 7515 Section 4.1.6.
Return
a JsonElement.
Parameters
excludeRoot
if the certificate chain has more than one certificate and the last certificate is a root certificate (self-signed), exclude it.