async identityDrmParser_(drmTag, mimeType, getUris, initSegmentRef,
      variables) {
    if (mimeType == 'video/mp2t') {
      throw new shaka.util.Error(
          shaka.util.Error.Severity.CRITICAL,
          shaka.util.Error.Category.MANIFEST,
          shaka.util.Error.Code.HLS_MSE_ENCRYPTED_MP2T_NOT_SUPPORTED);
    }

    if (shaka.drm.DrmUtils.isMediaKeysPolyfilled('apple')) {
      throw new shaka.util.Error(
          shaka.util.Error.Severity.CRITICAL,
          shaka.util.Error.Category.MANIFEST,
          shaka.util.Error.Code
              .HLS_MSE_ENCRYPTED_LEGACY_APPLE_MEDIA_KEYS_NOT_SUPPORTED);
    }

    const method = drmTag.getRequiredAttrValue('METHOD');
    const VALID_METHODS = ['SAMPLE-AES', 'SAMPLE-AES-CTR'];
    if (!VALID_METHODS.includes(method)) {
      shaka.log.error('Identity (ClearKey) in HLS is only supported with [',
          VALID_METHODS.join(', '), '], not', method);
      return null;
    }

    const keyUris = shaka.hls.Utils.constructSegmentUris(
        getUris(), drmTag.getRequiredAttrValue('URI'), variables);

    let key;
    if (keyUris[0].startsWith('data:text/plain;base64,')) {
      key = shaka.util.Uint8ArrayUtils.toHex(
          shaka.util.Uint8ArrayUtils.fromBase64(
              keyUris[0].split('data:text/plain;base64,').pop()));
    } else {
      const keyMapKey = keyUris.sort().join('');
      if (!this.identityKeyMap_.has(keyMapKey)) {
        const requestType = shaka.net.NetworkingEngine.RequestType.KEY;
        const request = shaka.net.NetworkingEngine.makeRequest(
            keyUris, this.config_.retryParameters);
        const keyResponse = this.makeNetworkRequest_(request, requestType)
            .promise;
        this.identityKeyMap_.set(keyMapKey, keyResponse);
      }
      const keyResponse = await this.identityKeyMap_.get(keyMapKey);
      key = shaka.util.Uint8ArrayUtils.toHex(keyResponse.data);
    }

    // NOTE: The ClearKey CDM requires a key-id to key mapping.  HLS doesn't
    // provide a key ID anywhere.  So although we could use the 'URI' attribute
    // to fetch the actual 16-byte key, without a key ID, we can't provide this
    // automatically to the ClearKey CDM. By default we assume that keyId is 0,
    // but we will try to get key ID from Init Segment.
    // If the application want override this behavior will have to use
    // player.configure('drm.clearKeys', { ... }) to provide the key IDs
    // and keys or player.configure('drm.servers.org\.w3\.clearkey', ...) to
    // provide a ClearKey license server URI.
    let keyId = '00000000000000000000000000000000';

    if (initSegmentRef) {
      const defaultKID = await this.getKeyIdFromInitSegment_(initSegmentRef);
      if (defaultKID) {
        keyId = defaultKID;
      }
    }

    const clearkeys = new Map();
    clearkeys.set(keyId, key);

    let encryptionScheme = 'cenc';
    if (method == 'SAMPLE-AES') {
      encryptionScheme = 'cbcs';
    }

    return shaka.util.ManifestParserUtils.createDrmInfoFromClearKeys(
        clearkeys, encryptionScheme);
  }
See: https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-11#section-5.1

@param {!shaka.hls.Tag} drmTag
@param {string} mimeType
@param {function(): !Array<string>} getUris
@param {?shaka.media.InitSegmentReference} initSegmentRef
@param {?Map<string, string>=} variables
@return {!Promise<?shaka.extern.DrmInfo>}
@private