Skip to content

Instantly share code, notes, and snippets.

@TomMaddox
TomMaddox / JuiceSSH-validateKeyFile(File)
Last active April 4, 2022 02:28
JuiceSSH Validate Key File
public static boolean validateKeyFile(File fileHandle) {
final int fileSizeLimitKB = 8;
if (fileHandle.length() > fileSizeLimitKB * 1024) {
return false;
}
try {
InputStream is = new FileInputStream(fileHandle);
BufferedReader reader = new BufferedReader(new InputStreamReader(is));