private boolean shouldEncryptAttribute(final Attribute attribute) {
        val encryptableAttributes = service.getEncryptableAttributes();
        if (encryptableAttributes == null || encryptableAttributes.isEmpty() || encryptableAttributes.contains("*")) {
            LOGGER.debug("No explicit attribute encryption rules are defined; Attribute [{}] is selected for encryption.", attribute.getName());
            return true;
        }
        if (encryptableAttributes.contains(attribute.getName()) || encryptableAttributes.contains(attribute.getFriendlyName())) {
            LOGGER.debug("Attribute encryption rules allow [{}] to be encrypted", attribute.getName());
            return true;
        }
        LOGGER.debug("Skipping encryption as attribute encryption rules do NOT allow [{}] to be encrypted", attribute.getName());
        return false;
    }
This is {@link SamlProfileSamlRegisteredServiceAttributeBuilder}.

@author Misagh Moayyed
@since 6.0.0
support/cas-server-support-saml-idp-web/src/main/java/org/apereo/cas/support/saml/web/idp/profile/builders/attr/SamlProfileSamlRegisteredServiceAttributeBuilder.java