protected boolean encryptAssertionFor(final SamlProfileBuilderContext context) {
        return context.getRegisteredService().isEncryptAssertions()
            || SamlIdPUtils.doesEntityDescriptorMatchEntityAttribute(context.getAdaptor().getEntityDescriptor(),
            List.of(MetadataEntityAttributeQuery.of(SamlIdPConstants.KnownEntityAttributes.SHIBBOLETH_ENCRYPT_ASSERTIONS.getName(),
                Attribute.URI_REFERENCE, List.of(Boolean.TRUE.toString()))));
    }
The {@link BaseSamlProfileSamlResponseBuilder} is responsible for
building the final SAML assertion for the relying party.

@author Misagh Moayyed
@since 4.2
support/cas-server-support-saml-idp-web/src/main/java/org/apereo/cas/support/saml/web/idp/profile/builders/response/BaseSamlProfileSamlResponseBuilder.java