code: def has_encrypt_cert_in_metadata(self, sp_entity_id):
          
          if sp_entity_id is not None:
              _certs = self.metadata.certs(sp_entity_id, "any", "encryption")
              if len(_certs) > 0:
                  return True
          return False
docs: Verifies if the metadata contains encryption certificates.
  
          :param sp_entity_id: Entity ID for the calling service provider.
          :return: True if encrypt cert exists in metadata, otherwise False.