diff options
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/SshKeyGen.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/SshKeyGen.java b/app/src/main/java/com/zeapo/pwdstore/SshKeyGen.java index 11db75b4..40c44065 100644 --- a/app/src/main/java/com/zeapo/pwdstore/SshKeyGen.java +++ b/app/src/main/java/com/zeapo/pwdstore/SshKeyGen.java @@ -175,7 +175,11 @@ public class SshKeyGen extends AppCompatActivity { File file = new File(getFilesDir() + "/.ssh_key"); FileOutputStream out = new FileOutputStream(file, false); - kp.writePrivateKey(out, passphrase.getBytes()); + if (passphrase.length() > 0) { + kp.writePrivateKey(out, passphrase.getBytes()); + } else { + kp.writePrivateKey(out); + } file = new File(getFilesDir() + "/.ssh_key.pub"); out = new FileOutputStream(file, false); |