Namespaces

 
0.2.0-SNAPSHOT Arrow_down_16x16

add-identity-with-keychain

clj-ssh.ssh

  • (add-identity-with-keychain)
  • (add-identity-with-keychain private-key-path)
  • (add-identity-with-keychain agent private-key-path)
Add a private key, only if not already known, using the keychain to obtain
a passphrase if required

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clj_ssh/ssh.clj:166 top

(defn add-identity-with-keychain
  "Add a private key, only if not already known, using the keychain to obtain
   a passphrase if required"
  ([] (add-identity-with-keychain *ssh-agent* (default-identity)))
  ([private-key-path] (add-identity-with-keychain *ssh-agent* private-key-path))
  ([agent private-key-path]
     (when-not (has-identity? agent private-key-path)
       (let [identity (make-identity
                       agent
                       (file-path private-key-path)
                       (str private-key-path ".pub"))]
         (if (.isEncrypted identity)
           (if-let [passphrase (clj-ssh.keychain/passphrase private-key-path)]
             (add-identity agent identity passphrase)
             (logging/error "Passphrase required, but none findable."))
           (add-identity agent identity))))))
Vars in clj-ssh.ssh/add-identity-with-keychain: agent defn identity if-let let when-not
Used in 0 other vars

Comments top

No comments for add-identity-with-keychain. Log in to add a comment.