docs: def serialize_cert_to_pem(cert_obj):
      """Serialize certificate to PEM.
  
      The certificate can be also be a Certificate Signing Request (CSR).
  
      Args:
        cert_obj: cryptography.Certificate
  
      Returns:
        bytes: PEM encoded certificate
  
      """
      return cert_obj.public_bytes(
          encoding=cryptography.hazmat.primitives.serialization.Encoding.PEM
      )