class ExplicitSignatureTrustEngineProvider implements SAML2SignatureTrustEngineProvider {

    private final SAML2MetadataResolver idpMetadataResolver;

    private final SAML2MetadataResolver spMetadataResolver;

    /**
     * <p>Constructor for ExplicitSignatureTrustEngineProvider.</p>
     *
     * @param idpMetadataResolver a {@link SAML2MetadataResolver} object
     * @param spMetadataResolver a {@link SAML2MetadataResolver} object
     */
    public ExplicitSignatureTrustEngineProvider(final SAML2MetadataResolver idpMetadataResolver,
                                                final SAML2MetadataResolver spMetadataResolver) {
        this.idpMetadataResolver = idpMetadataResolver;
        this.spMetadataResolver = spMetadataResolver;
    }

    /** {@inheritDoc} */
    @Override
    public SignatureTrustEngine build() {<FILL_FUNCTION_BODY>}
}

        val metadataCredentialResolver = new MetadataCredentialResolver();
        final MetadataResolver metadataResolver = SAML2Utils.buildChainingMetadataResolver(idpMetadataResolver, spMetadataResolver);
        val roleResolver = new PredicateRoleDescriptorResolver(metadataResolver);

        val keyResolver =
                DefaultSecurityConfigurationBootstrap.buildBasicInlineKeyInfoCredentialResolver();

        metadataCredentialResolver.setKeyInfoCredentialResolver(keyResolver);
        metadataCredentialResolver.setRoleDescriptorResolver(roleResolver);

        try {
            metadataCredentialResolver.initialize();
            roleResolver.initialize();
        } catch (final ComponentInitializationException e) {
            throw new SAMLException(e);
        }

        return new ExplicitKeySignatureTrustEngine(metadataCredentialResolver, keyResolver);
    
<no_super_class>