private static boolean matchHex(final String matchKey, final JsonNode matchValue, final ASN1Primitive value) {
        val matchValueString = matchValue.get(EXTENSION_VALUE_VALUE).textValue();
        final ByteArray matchBytes;
        try {
            matchBytes = ByteArray.fromHex(matchValueString);
        } catch (final HexException e) {
            throw new IllegalArgumentException(
                String.format("Bad hex value in extension %s: %s", matchKey, matchValueString));
        }

        final ASN1Primitive innerValue;
        if (value instanceof final DEROctetString instance) {
            try {
                innerValue = ASN1Primitive.fromByteArray(instance.getOctets());
            } catch (final IOException e) {
                LOGGER.debug("Failed to parse {} extension value as ASN1: {}", matchKey, value);
                return false;
            }
        } else {
            LOGGER.debug("Expected nested bit string value for extension {}, was: {}", matchKey, value);
            return false;
        }

        if (innerValue instanceof final DEROctetString octetString) {
            val readBytes = new ByteArray(octetString.getOctets());
            return matchBytes.equals(readBytes);
        } else {
            LOGGER.debug("Expected nested bit string value for extension {}, was: {}", matchKey, value);
            return false;
        }
    }
This is {@link ExtensionMatcher}.

@author Misagh Moayyed
@since 6.6.0
support/cas-server-support-webauthn-core/src/main/java/com/yubico/webauthn/attestation/matcher/ExtensionMatcher.java