@Override
    public Optional<Attestation> findMetadata(final X509Certificate attestationCertificate) {
        return metadataObjects.stream()
            .map(metadata -> {
                Map<String, String> vendorProperties;
                Map<String, String> deviceProperties = null;
                String identifier;

                identifier = metadata.getIdentifier();
                vendorProperties = Maps.filterValues(metadata.getVendorInfo(), Objects::nonNull);
                for (val device : metadata.getDevices()) {
                    if (deviceMatches(device.get(SELECTORS), attestationCertificate)) {
                        val devicePropertiesBuilder = ImmutableMap.<String, String>builder();
                        for (val deviceEntry : Lists.newArrayList(device.fields())) {
                            val value = deviceEntry.getValue();
                            if (value.isTextual()) {
                                devicePropertiesBuilder.put(deviceEntry.getKey(), value.asText());
                            }
                        }
                        deviceProperties = devicePropertiesBuilder.build();
                        break;
                    }
                }

                return Optional.ofNullable(deviceProperties)
                    .map(
                        deviceProps ->
                            Attestation.builder()
                                .metadataIdentifier(Optional.ofNullable(identifier))
                                .vendorProperties(Optional.of(vendorProperties))
                                .deviceProperties(deviceProps)
                                .build());
            })
            .filter(Optional::isPresent)
            .map(Optional::get)
            .findAny();
    }
This is {@link YubicoJsonMetadataService}.

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