@Override
    public <T extends SAMLObject> T encode(final T samlObject,
                                           final SamlRegisteredService service,
                                           final SamlRegisteredServiceMetadataAdaptor adaptor,
                                           final HttpServletResponse response,
                                           final HttpServletRequest request,
                                           final String binding,
                                           final RequestAbstractType authnRequest,
                                           final MessageContext messageContext) throws Exception {
        LOGGER.trace("Attempting to encode [{}] for [{}]", samlObject.getClass().getName(), adaptor.getEntityId());
        prepareOutboundContext(samlObject, adaptor, messageContext, binding, authnRequest);
        prepareSecurityParametersContext(adaptor, messageContext, service);
        prepareEndpointURLSchemeSecurityHandler(messageContext);
        prepareSamlOutboundDestinationHandler(messageContext);
        prepareSamlOutboundProtocolMessageSigningHandler(messageContext);
        return samlObject;
    }
This is {@link DefaultSamlIdPObjectSigner}.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-saml-idp-web/src/main/java/org/apereo/cas/support/saml/web/idp/profile/builders/enc/DefaultSamlIdPObjectSigner.java