code: def pem(self):
          
          bio = Membio()
          if not libcrypto.PEM_write_bio_CMS(bio.bio, self.ptr):
              raise CMSError("writing CMS to PEM")
          return str(bio)
docs: Serialize in PEM format