no.difi.certvalidator.util.SimplePrincipalNameProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of commons-certvalidator Show documentation
Show all versions of commons-certvalidator Show documentation
Rule engine for creation of certificate validator.
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.expected = Arrays.asList(expected);
}
/**
* {@inheritDoc}
*/
@Override
public boolean validate(String value) {
return expected.contains(value);
}
}