/** * Utility function for createing a {@link KeyProvider} instance from given location on the file * system. Creates a one-off {@link PasswordFinder} using {@link * PasswordUtils#createOneOff(char[])}, and calls {@link #loadKeys(String, PasswordFinder)}. * * @param location location of the key file * @param passphrase passphrase as a char-array * @return the key provider ready for use in authentication * @throws SSHException if there was no suitable key provider available for the file format; * typically because BouncyCastle is not in the classpath * @throws IOException if the key file format is not known, if the file could not be read, etc. */ public KeyProvider loadKeys(String location, char[] passphrase) throws IOException { return loadKeys(location, PasswordUtils.createOneOff(passphrase)); }