@Override
    protected String resolvePrincipalInternal(final X509Certificate certificate) {
        LOGGER.debug("Resolving principal from Subject Alternative Name RFC8222 type (email) for [{}]", certificate);
        try {
            val subjectAltNames = certificate.getSubjectAlternativeNames();
            val email = X509ExtractorUtils.getRFC822EmailAddress(subjectAltNames);
            if (email.isPresent()) {
                return email.get();
            }
        } catch (final CertificateParsingException e) {
            LoggingUtils.error(LOGGER, e);
        }
        return getAlternatePrincipal(certificate);
    }
Credential to principal resolver that extracts Subject Alternative Name RFC822 extension
from the provided certificate if available as a resolved principal id.

@author Hal Deadman
@since 6.1.0
support/cas-server-support-x509-core/src/main/java/org/apereo/cas/adaptors/x509/authentication/principal/X509SubjectAlternativeNameRFC822EmailPrincipalResolver.java