This parser doesn't prove that the appropriate match of password to store type is done. How about 

1) adding EnumSet<Attribute> required = EnumSet.noneOf(Attribute.class);
2) For each "KEYSTORE" attribute case, add a line: 
   required.add(Attribute.KEYSTORE_PASSWORD)
3) For each "TRUSTSTORE" attribute case, add a line: 
  required.add(Attribute.TRUSTSTORE_PASSWORD)

This test becomes if (!visited.containsAll(required))