All Downloads are FREE. Search and download functionalities are using the official Maven repository.

no.difi.certvalidator.util.SimplePrincipalNameProvider Maven / Gradle / Ivy

There is a newer version: 2.2.1
Show newest version
package no.difi.certvalidator.util;

import no.difi.certvalidator.api.PrincipalNameProvider;

import java.util.Arrays;
import java.util.List;

/**
 * Validate principal name using a static list of values.
 */
public class SimplePrincipalNameProvider implements PrincipalNameProvider {

    private List expected;

    public SimplePrincipalNameProvider(String... expected) {
        this(Arrays.asList(expected));
    }

    public SimplePrincipalNameProvider(List expected) {
        this.expected = expected;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean validate(String value) {
        return expected.contains(value);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy