class urn_perun_user_attribute_def_def_userCertDNs extends UserAttributesModuleAbstract implements UserAttributesModuleImplApi {

	@Override
	public void checkAttributeSyntax(PerunSessionImpl sess, User user, Attribute attribute) throws WrongAttributeValueException {
		if(attribute.getValue() == null) return;
		Map<String, String> value = attribute.valueAsMap();

		Set<String> valueKeys = value.keySet();
		for(String k: valueKeys) {
			Matcher certKeyMatcher = certPattern.matcher(k);
			if(!certKeyMatcher.find()) throw new WrongAttributeValueException(attribute, "There is wrong value for key " + k + " in hashMap of userCertDNs.");
			String valueOfKey = value.get(k);
			Matcher certValueOfKeyMatcher = certPattern.matcher(valueOfKey);
			if(!certValueOfKeyMatcher.find()) throw new WrongAttributeValueException(attribute, "There is wrong value for key's value " + valueOfKey + " in hashMap of UserCertDns for key " + k);
		}
	}

}