A developer should not know where cacerts is, it will nice if there is a public API returning it as a KeyStore object.
Comments
Maybe the java.security.Security class would be a better location for such static methods.
For example,
public static KeyStore getCACerts(char[] password)
public static KeyStore getCACerts(KeyStore.LoadStoreParameter parameter)
31-08-2017
Yes, something like 2 overloaded methods:
public static KeyStore cacerts(char[] password);
public static KeyStore cacerts(KeyStore.ProtectionParameter param);
Even with a password, we probably want to have a permission check on that, since it is reading from a file and someone may have added certs or keys with sensitive information to the cacerts file (and the "changeit" password may not have been changed).