protected void extractExtensionFromCertificate(UserProfile profile, final X509Certificate certificate,
                                                   final String attribute, final int oid) {
        try {
            val subjectAlternativeNames = certificate.getSubjectAlternativeNames();
            if (subjectAlternativeNames != null) {
                val values = subjectAlternativeNames
                    .stream()
                    .filter(entry -> entry.size() == 2)
                    .filter(entry -> entry.get(0).equals(oid))
                    .map(entry -> entry.get(1).toString())
                    .toList();
                if (!values.isEmpty()) {
                    profile.addAttribute(attribute, values);
                }
            }
        } catch (Exception e) {
            logger.debug("Unable to extract extension", e);
        }
    }
Authenticates {@link X509Credentials}. Like the SubjectDnX509PrincipalExtractor in Spring Security.

@author Jerome Leleu
@since 3.3.0
pac4j-http/src/main/java/org/pac4j/http/credentials/authenticator/X509Authenticator.java