class X509RoleCertRequest extends X509CertRequest {

    public boolean validate(Set<String> roles, final String domainName, final String principal,
            final String proxyUser, Set<String> validCertSubjectOrgValues) {

        // validate that the common name matches to the role name
        // that is being returned in the response

        final String roleName = validateAndExtractRoleName(roles, domainName);
        if (roleName == null) {
            LOGGER.error("validateRoleCertificateRequest: unable to validate role name");
            return false;
        }

        // now let's check if we have an rfc822 field for the principal

        if (!validateEmail(principal)) {
            return false;
        }

        // let's check if we have a uri for the proxy user

        if (proxyUser != null && !validateProxyUserUri(proxyUser)) {
            return false;
        }

        // validate the o field value is specified

        if (!validateSubjectOField(validCertSubjectOrgValues)) {
            return false;
        }

        // validate spiffe uri if one is provided

        return validateSpiffeURI(domainName, "ra", roleName);
    }

    public  X509RoleCertRequest(String csr);

}