class X509RoleCertRequest extends X509CertRequest {

    public Map<String, String[]> getRequestedRoleList() {

        // first extract the URI list from the request

        if (uris == null || uris.isEmpty()) {
            return null;
        }

        Map<String, List<String>> domainRoles = new HashMap<>();

        // the format of our URIs is:
        // athenz://role/<domainName>/<roleName>

        for (String uri : uris) {

            if (!uri.toLowerCase().startsWith(ZTSConsts.ZTS_CERT_ROLE_URI)) {
                continue;
            }

            final String roleUri = uri.substring(ZTSConsts.ZTS_CERT_ROLE_URI.length());
            int idx = roleUri.indexOf('/');
            if (idx == -1) {
                if (LOGGER.isDebugEnabled()) {
                    LOGGER.debug("Invalid role name '{}' in CSR", uri);
                }
                return null;
            }

            final String domainName = roleUri.substring(0, idx);
            List<String> rolesForDomain = domainRoles.get(domainName);
            if (rolesForDomain == null) {
                rolesForDomain = new ArrayList<>();
                domainRoles.put(domainName, rolesForDomain);
            }
            rolesForDomain.add(roleUri.substring(idx + 1));
        }

        if (domainRoles.isEmpty()) {
            return null;
        }

        Map<String, String[]> roles = new HashMap<>();
        for (String domainName : domainRoles.keySet()) {
            roles.put(domainName, domainRoles.get(domainName).toArray(new String[0]));
        }

        return roles;
    }

    public  X509RoleCertRequest(String csr);

}