class KerberosProperties {

    public static List<ValidationResult> validatePrincipalAndKeytab(final String subject, final Configuration config, final String principal, final String keytab, final ComponentLog logger) {
        final List<ValidationResult> results = new ArrayList<>();

        // if security is enabled then the keytab and principal are required
        final boolean isSecurityEnabled = SecurityUtil.isSecurityEnabled(config);

        final boolean blankPrincipal = (principal == null || principal.isEmpty());
        if (isSecurityEnabled && blankPrincipal) {
            results.add(new ValidationResult.Builder()
                    .valid(false)
                    .subject(subject)
                    .explanation("Kerberos Principal must be provided when using a secure configuration")
                    .build());
        }

        final boolean blankKeytab = (keytab == null || keytab.isEmpty());
        if (isSecurityEnabled && blankKeytab) {
            results.add(new ValidationResult.Builder()
                    .valid(false)
                    .subject(subject)
                    .explanation("Kerberos Keytab must be provided when using a secure configuration")
                    .build());
        }

        if (!isSecurityEnabled && (!blankPrincipal || !blankKeytab)) {
            logger.warn("Configuration does not have security enabled, Keytab and Principal will be ignored");
        }

        return results;
    }

    public  KerberosProperties(final File kerberosConfigFile);

}