code: def SetCredential(self, path_spec, identifier, data):
      
      supported_credentials = manager.CredentialsManager.GetCredentials(path_spec)
  
      if identifier not in supported_credentials.CREDENTIALS:
        raise KeyError((
            'Unsuppored credential: {0:s} for path specification type: '
            '{1:s}').format(identifier, path_spec.type_indicator))
  
      credentials = self._credentials_per_path_spec.get(path_spec.comparable, {})
      credentials[identifier] = data
      self._credentials_per_path_spec[path_spec.comparable] = credentials
docs: Sets a specific credential for the path specification.
  
      Args:
        path_spec (PathSpec): path specification.
        identifier (str): credential identifier.
        data (object): credential data.
  
      Raises:
        KeyError: if the credential is not supported by the path specification
            type.