class EidasUnsignedAssertionsTransformer {

    public Assertion transform(HubEidasAttributeQueryRequest originalQuery) {

        CountrySignedResponseContainer countrySignedResponseContainer = originalQuery.getCountrySignedResponseContainer().get();
        Assertion assertion = openSamlXmlObjectFactory.createAssertion();
        DateTime now = DateTime.now();
        assertion.setIssueInstant(now);
        String unsignedCountryIssuer = countrySignedResponseContainer.getCountryEntityId();
        assertion.setIssuer(openSamlXmlObjectFactory.createIssuer(unsignedCountryIssuer));
        assertion.setID(UUID.randomUUID().toString());

        Conditions conditions = openSamlXmlObjectFactory.createConditions();
        conditions.setNotBefore(now);
        conditions.setNotOnOrAfter(now.plusMinutes(5));
        AudienceRestriction audienceRestriction = openSamlXmlObjectFactory.createAudienceRestriction(hubEidasEntityId);
        conditions.getAudienceRestrictions().add(audienceRestriction);
        assertion.setConditions(conditions);

        Subject subject = openSamlXmlObjectFactory.createSubject();
        SubjectConfirmation subjectConfirmation = openSamlXmlObjectFactory.createSubjectConfirmation();
        SubjectConfirmationData subjectConfirmationData = createSubjectConfirmationData(originalQuery);
        subjectConfirmation.setSubjectConfirmationData(subjectConfirmationData);
        subject.getSubjectConfirmations().add(subjectConfirmation);
        subject.setNameID(openSamlXmlObjectFactory.createNameId(originalQuery.getPersistentId().getNameId()));
        assertion.setSubject(subject);

        AuthnStatement authnStatement = openSamlXmlObjectFactory.createAuthnStatement();
        AttributeStatement attributeStatement = openSamlXmlObjectFactory.createAttributeStatement();
        List<Attribute> attributes = attributeStatement.getAttributes();
        Attribute samlResponseAttribute = createCountrySamlResponseAttribute(countrySignedResponseContainer.getBase64SamlResponse());
        Attribute keysAttribute = createEncryptedAssertionKeysAttribute(countrySignedResponseContainer.getBase64encryptedKeys());
        attributes.add(samlResponseAttribute);
        attributes.add(keysAttribute);
        assertion.getAttributeStatements().add(attributeStatement);
        assertion.getAuthnStatements().add(authnStatement);
        setAuthnContextWithEidasLOA(originalQuery, authnStatement);
        return assertion;
    }

    public  EidasUnsignedAssertionsTransformer(OpenSamlXmlObjectFactory openSamlXmlObjectFactory, AuthnContextFactory authnContextFactory, String hubEidasEntityId);

}