aboutsummaryrefslogtreecommitdiffstats
path: root/lib/src/main/java/com/trilead/ssh2/AuthAgentCallback.java
blob: 2bd10e0a88d98ad4e04afd02252f4cf039ed2a70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package com.trilead.ssh2;

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 key 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
	 * @return success or failure
	 */
	boolean addIdentity(Object key, String comment);

	/**
	 * @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.
	 */
	Object getPrivateKey(byte[] publicKey);
}