class X509RoleCertRequest extends X509CertRequest {

    public boolean validateIPAddress(X509Certificate cert, final String ip) {

        // if we have no IP addresses in the request, then we're good

        if (ipAddresses.isEmpty()) {
            return true;
        }

        // if we have a certificate then we need to make sure
        // that all the ip addresses in the request match
        // the ip addresses in the certificate

        if (cert != null) {

            List<String> certIPs = Crypto.extractX509CertIPAddresses(cert);

            // if the certificate has no ip then we'll do
            // validation based on the connection ip

            if (!certIPs.isEmpty()) {
                return certIPs.containsAll(ipAddresses);
            }
        }

        return validateIPAddress(ip);
    }

    public  X509RoleCertRequest(String csr);

}