aboutsummaryrefslogtreecommitdiffstats
path: root/sshlib/src/main/java/com/trilead/ssh2/AuthAgentCallback.java
diff options
context:
space:
mode:
authorKenny Root <kenny@the-b.org>2015-07-18 11:30:18 -0700
committerKenny Root <kenny@the-b.org>2015-07-18 11:30:18 -0700
commit2f5f3754dce85212a71138fd80c2300b73461908 (patch)
treeac51a1c9f143bc77a0cfec2e7da1b7c184394a98 /sshlib/src/main/java/com/trilead/ssh2/AuthAgentCallback.java
parent0cf7ac30faecc82e04b080f418b08758624b07f5 (diff)
downloadsshlib-2f5f3754dce85212a71138fd80c2300b73461908.tar.gz
sshlib-2f5f3754dce85212a71138fd80c2300b73461908.tar.bz2
sshlib-2f5f3754dce85212a71138fd80c2300b73461908.zip
Rename project to sshlib
Diffstat (limited to 'sshlib/src/main/java/com/trilead/ssh2/AuthAgentCallback.java')
-rw-r--r--sshlib/src/main/java/com/trilead/ssh2/AuthAgentCallback.java64
1 files changed, 64 insertions, 0 deletions
diff --git a/sshlib/src/main/java/com/trilead/ssh2/AuthAgentCallback.java b/sshlib/src/main/java/com/trilead/ssh2/AuthAgentCallback.java
new file mode 100644
index 0000000..96f2d07
--- /dev/null
+++ b/sshlib/src/main/java/com/trilead/ssh2/AuthAgentCallback.java
@@ -0,0 +1,64 @@
+package com.trilead.ssh2;
+
+import java.security.KeyPair;
+import java.util.Map;
+
+/**
+ * AuthAgentCallback.
+ *
+ * @author Kenny Root
+ * @version $Id$
+ */
+public interface AuthAgentCallback {
+
+ /**
+ * @return array of blobs containing the OpenSSH-format encoded public keys
+ */
+ Map<String,byte[]> retrieveIdentities();
+
+ /**
+ * @param pair A <code>RSAPrivateKey</code> or <code>DSAPrivateKey</code>
+ * containing a DSA or RSA private key of
+ * the user in Trilead object format.
+ * @param comment comment associated with this key
+ * @param confirmUse whether to prompt before using this key
+ * @param lifetime lifetime in seconds for key to be remembered
+ * @return success or failure
+ */
+ boolean addIdentity(KeyPair pair, String comment, boolean confirmUse, int lifetime);
+
+ /**
+ * @param publicKey byte blob containing the OpenSSH-format encoded public key
+ * @return success or failure
+ */
+ boolean removeIdentity(byte[] publicKey);
+
+ /**
+ * @return success or failure
+ */
+ boolean removeAllIdentities();
+
+ /**
+ * @param publicKey byte blob containing the OpenSSH-format encoded public key
+ * @return A <code>RSAPrivateKey</code> or <code>DSAPrivateKey</code>
+ * containing a DSA or RSA private key of
+ * the user in Trilead object format.
+ */
+ KeyPair getKeyPair(byte[] publicKey);
+
+ /**
+ * @return
+ */
+ boolean isAgentLocked();
+
+ /**
+ * @param lockPassphrase
+ */
+ boolean setAgentLock(String lockPassphrase);
+
+ /**
+ * @param unlockPassphrase
+ * @return
+ */
+ boolean requestAgentUnlock(String unlockPassphrase);
+}