Skip to content

Commit 87afc44

Browse files
committed
Allow keypair construction from just a public key
1 parent 22a82e0 commit 87afc44

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/clj_ssh/ssh.clj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@
153153
(.setPublicKeyComment keypair comment)
154154
keypair)
155155

156+
public-key
157+
(let [^KeyPair keypair (KeyPair/load agent nil (as-bytes public-key))]
158+
(.setPublicKeyComment keypair comment)
159+
keypair)
160+
156161
(and public-key-path private-key-path)
157162
(let [keypair (KeyPair/load agent private-key-path public-key-path)]
158163
(when passphrase

0 commit comments

Comments
 (0)