MtoJSON
Bun

method

crypto.X509Certificate.toJSON

toJSON(): string;

There is no standard JSON encoding for X509 certificates. ThetoJSON() method returns a string containing the PEM encoded certificate.