private static KeyPair parsePrivateKeyFile(File keyFile) {
        if (keyFile == null) {
          return null;
        }

        try {
            JSch jsch = new JSch();
            KeyPair key = KeyPair.load(jsch, keyFile.getAbsolutePath());
            return key;
        } catch (JSchException ex) {
            return null;
        }
    }
private static KeyPair parsePrivateKeyFile ( File keyFile ) { if ( keyFile == null ) { return null ; } try { JSch jsch = new JSch ( ) ; KeyPair key = KeyPair . load ( jsch , keyFile . getAbsolutePath ( ) ) ; return key ; } catch ( JSchException ex ) { return null ; } }
Parses the keyFile hiding any Exceptions that might occur.
@param keyFile the file.
@return the "parsed" file.