From 17fe2ab98ee6729996930a60f2d73db5de6344bb Mon Sep 17 00:00:00 2001 From: David Kocher Date: Mon, 23 Oct 2023 23:11:47 +0200 Subject: [PATCH] Override public key. --- .../sshj/userauth/keyprovider/OpenSSHKeyV1KeyFile.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/com/hierynomus/sshj/userauth/keyprovider/OpenSSHKeyV1KeyFile.java b/src/main/java/com/hierynomus/sshj/userauth/keyprovider/OpenSSHKeyV1KeyFile.java index ba91512ef..04de5b409 100644 --- a/src/main/java/com/hierynomus/sshj/userauth/keyprovider/OpenSSHKeyV1KeyFile.java +++ b/src/main/java/com/hierynomus/sshj/userauth/keyprovider/OpenSSHKeyV1KeyFile.java @@ -84,6 +84,12 @@ public class OpenSSHKeyV1KeyFile extends BaseFileKeyProvider { private PublicKey pubKey; + @Override + public PublicKey getPublic() + throws IOException { + return pubKey != null ? pubKey : super.getPublic(); + } + public static class Factory implements net.schmizz.sshj.common.Factory.Named {