class BouncyCastleUtils {

    public static boolean x500NameCompare(final String nameValue1, final String nameValue2) {
        if (nameValue1 == null || nameValue2 == null) {
            throw new IllegalArgumentException("Provided DN string is null.");
        }

        boolean result = false;
        X500Name x500Name1;
        X500Name x500Name2;

        try {
            x500Name1 = new X500Name(nameValue1.replace(SEPARATOR_PLUS, SEPARATOR_COMMA));
            x500Name2 = new X500Name(nameValue2.replace(SEPARATOR_PLUS, SEPARATOR_COMMA));
            result = x500Name1.equals(x500Name2);
        } catch (IllegalArgumentException iaEx) {
            LOGGER.error(iaEx.toString());
        }

        return result;
    }

    private  BouncyCastleUtils();

}