@Override
    public EntityStatement createAndSign() throws Exception {
        val iss = new EntityID(serverDiscoverySettings.getIssuer());
        val sub = new EntityID(serverDiscoverySettings.getIssuer());

        val iat = DateTimeUtils.dateOf(LocalDate.now(Clock.systemUTC()));
        val exp = DateTimeUtils.dateOf(LocalDate.now(Clock.systemUTC()).plusYears(10));
        val claims = new EntityStatementClaimsSet(
            iss,
            sub,
            iat,
            exp,
            jsonWebKeystoreService.toJWKSet()
        );

        val authorityHints = oidcProperties.getFederation().getAuthorityHints().stream().map(EntityID::new).toList();
        claims.setAuthorityHints(authorityHints);
        
        val discovery = serverDiscoverySettings.toJson();
        val opMetadata = OIDCProviderMetadata.parse(discovery);
        claims.setOPMetadata(opMetadata);
        
        val fedMeta = new FederationEntityMetadata();
        fedMeta.setOrganizationName(oidcProperties.getFederation().getOrganization());
        fedMeta.setContacts(oidcProperties.getFederation().getContacts());
        claims.setFederationEntityMetadata(fedMeta);

        return jsonWebKeystoreService.signEntityStatement(claims);
    }
This is {@link OidcFederationDefaultEntityStatementService}.

@author Misagh Moayyed
@since 7.3.0
support/cas-server-support-oidc-core-api/src/main/java/org/apereo/cas/oidc/federation/OidcFederationDefaultEntityStatementService.java