private ArtifactResolve buildArtifactResolveRequestMessage(final SAMLArtifact artifact,
                                                               final String endpoint,
                                                               final String selfEntityID) {

        val request =
            (ArtifactResolve) XMLObjectSupport.buildXMLObject(ArtifactResolve.DEFAULT_ELEMENT_NAME);

        val requestArtifact = (Artifact) XMLObjectSupport.buildXMLObject(Artifact.DEFAULT_ELEMENT_NAME);
        try {
            requestArtifact.setValue(Base64Support.encode(artifact.getArtifactBytes(), false));
        } catch (final Exception e) {
            throw new RuntimeException(e);
        }
        request.setArtifact(requestArtifact);

        request.setID(idStrategy.generateIdentifier(true));
        request.setDestination(endpoint);
        request.setIssueInstant(Instant.now());
        request.setIssuer(buildIssuer(selfEntityID));

        return request;
    }
Build the SAML protocol message for artifact resolution.

@param artifact     the artifact being de-referenced
@param endpoint     the peer artifact resolution service endpoint
@param selfEntityID the entityID of this party, the issuer of the protocol request message
@return the SAML protocol message for artifact resolution
pac4j-saml/src/main/java/org/pac4j/saml/transport/Pac4jHTTPArtifactDecoder.java