#!/usr/bin/env bash

set -x

cat<<EOF
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<CoreConfiguration xmlns="http:/www.bos_bremen.de/2009/06/eID-Server-CoreConfig">
    <ServerUrl>https://${PUBLIC_HOSTNAME}/eidas-middleware</ServerUrl>
    <sessionManagerUsesDatabase>true</sessionManagerUsesDatabase>
    <sessionMaxPendingRequests>500</sessionMaxPendingRequests>
    <certificateWarningMargin>200</certificateWarningMargin>
    <TimerConfiguration>
        <certRenewal length="2" unit="11"/>
        <blacklistRenewal length="2" unit="11"/>
        <masterAndDefectListRenewal length="2" unit="11"/>
    </TimerConfiguration>
    <ServiceProvider entityID="qa-se-de-middleware" enabled="true">
        <EPAConnectorConfiguration updateCVC="true">
            <CVCRefID>qa-se-de-middleware</CVCRefID>
            <PkiConnectorConfiguration>
                <blackListTrustAnchor>MIIEcTCCA1mgAwIBAgIIDI0LEBD/wRIwDQYJKoZIhvcNAQELBQAwVzEnMCUGA1UEAwweYm9zIENBIGVJRCBDb21tdW5pY2F0aW9uIENlcnRzMR8wHQYDVQQKDBZicmVtZW4gb25saW5lIHNlcnZpY2VzMQswCQYDVQQGEwJERTAeFw0xMzA1MDcwNzQ5MjRaFw0xNjA1MDYwNzQ5MjRaMGgxHjAcBgNVBAMMFWRldi5nb3Zlcm5pa3VzLWVpZC5kZTEYMBYGA1UECwwPdGVzdGNlcnRpZmljYXRlMR8wHQYDVQQKDBZicmVtZW4gb25saW5lIHNlcnZpY2VzMQswCQYDVQQGEwJkZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL9ea6dQveXgc23F7jteqN9L023MpOI7BnqD4YxsrOMfEhHBj1tcr1VpZgxtamhHKEJEqptN5ObotyA/wKqeIBEzLgfLGqMyPqnSyejELRql1KYi+moCgMWNiU5FAfhd29Rgr8rPhPtBSgkO7DQdXzaTQxDxQssUTlK5AifIl/f0+/emGZUknAIfXxgXlNmuSCijAt1qoNkd+VS05unQFYKqb3BfxFQDgHqdm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0QBCQwIoAPMjAxNTA5MjMwODU1MjZagQ8yMDE4MDkyMzIzNTk1OVowFgYDVR0gBA8wDTALBgkEAH8ABwMBAQEwUQYDVR0RBEowSIEYY3NjYS1nZXJtYW55QGJzaS5idW5kLmRlhhxodHRwczovL3d3dy5ic2kuYnVuZC5kZS9jc2NhpA4wDDEKMAgGA1UEBwwBRDBRBgNVHRIESjBIgRhjc2NhLWdlcm1hbnlAYnNpLmJ1bmQuZGWGHGh0dHBzOi8vd3d3LmJzaS5idW5kLmRlL2NzY2GkDjAMMQowCAYDVQQHDAFEMBQGA1UdJQEB/wQKMAgGBmeBCAEBAzA1BgNVHR8ELjAsMCqgKKAmhiRodHRwOi8vd3d3LmJzaS5idW5kLmRlL3Rlc3RfY3NjYV9jcmwwCgYIKoZIzj0EAwMDZwAwZAIwPAvVTvhJuX0dIyd7Ouv0t03J2KA08JehN+RA6oVU7xvS7RbCLIcKNYqVRnC4eJrOAjB1X89X1lH/0Fq3HH1tKXw3ELw62dBrHeHGsn3kcWNXxYqr5iRobwJru3FPk5ka34s=</defectListTrustAnchor>
                <policyImplementationId>govDvca</policyImplementationId>
                <sslKeys id="default">
                    <serverCertificate>${DEMW_TLS_SERVER_CERT}</serverCertificate>
                    <clientCertificate>${DEMW_TLS_CLIENT_CERT}</clientCertificate>
                    <clientKey>${DEMW_TLS_CLIENT_KEY}</clientKey>
                </sslKeys>
                <terminalAuthService sslKeysId="default">
                    <url>https://dev.governikus-eid.de:9444/gov_dvca/ta-service</url>
                </terminalAuthService>
                <restrictedIdService sslKeysId="default">
                    <url>https://dev.governikus-eid.de:9444/gov_dvca/ri-service</url>
                </restrictedIdService>
                <passiveAuthService sslKeysId="default">
                    <url>https://dev.governikus-eid.de:9444/gov_dvca/pa-service</url>
                </passiveAuthService>
                <dvcaCertDescriptionService sslKeysId="default">
                    <url>https://dev.governikus-eid.de:9444/gov_dvca/certDesc-service</url>
                </dvcaCertDescriptionService>
            </PkiConnectorConfiguration>
            <PaosReceiverURL>https://${PUBLIC_HOSTNAME}/eidas-middleware/paosreceiver</PaosReceiverURL>
            <hoursRefreshCVCBeforeExpires>48</hoursRefreshCVCBeforeExpires>
        </EPAConnectorConfiguration>
    </ServiceProvider>
</CoreConfiguration>
EOF
