protected boolean signSamlResponseFor(final SamlProfileBuilderContext context) {
        return context.getRegisteredService().getSignResponses().isTrue()
            || SamlIdPUtils.doesEntityDescriptorMatchEntityAttribute(context.getAdaptor().getEntityDescriptor(),
            List.of(MetadataEntityAttributeQuery.of(SamlIdPConstants.KnownEntityAttributes.SHIBBOLETH_SIGN_RESPONSES.getName(),
                Attribute.URI_REFERENCE, List.of(Boolean.TRUE.toString()))));
    }
This is {@link SamlProfileSaml2ResponseBuilder}.

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