code: def get_subject(self):
          
          assert self.assertion.subject
          subject = self.assertion.subject
          subjconf = []
  
          if not self.verify_attesting_entity(subject.subject_confirmation):
              raise VerificationError("No valid attesting address")
  
          for subject_confirmation in subject.subject_confirmation:
              _data = subject_confirmation.subject_confirmation_data
  
              if subject_confirmation.method == SCM_BEARER:
                  if not self._bearer_confirmed(_data):
                      continue
              elif subject_confirmation.method == SCM_HOLDER_OF_KEY:
                  if not self._holder_of_key_confirmed(_data):
                      continue
              elif subject_confirmation.method == SCM_SENDER_VOUCHES:
                  pass
              else:
                  raise ValueError("Unknown subject confirmation method: %s" % (
                      subject_confirmation.method,))
  
              _recip = _data.recipient
              if not _recip or not self.verify_recipient(_recip):
                  raise VerificationError("No valid recipient")
  
              subjconf.append(subject_confirmation)
  
          if not subjconf:
              raise VerificationError("No valid subject confirmation")
  
          subject.subject_confirmation = subjconf
  
          # The subject may contain a name_id
  
          if subject.name_id:
              self.name_id = subject.name_id
          elif subject.encrypted_id:
              # decrypt encrypted ID
              _name_id_str = self.sec.decrypt(
                  subject.encrypted_id.encrypted_data.to_string())
              _name_id = saml.name_id_from_string(_name_id_str)
              self.name_id = _name_id
  
          logger.info("Subject NameID: %s", self.name_id)
          return self.name_id
docs: The assertion must contain a Subject