A Java library that talks to the local ssh-agent. This project is currently in beta phase.
Download the latest JAR or grab via Maven.
<dependency>
<groupId>com.spotify</groupId>
<artifactId>ssh-agent-proxy</artifactId>
<version>0.1.5</version>
</dependency>
import org.apache.commons.codec.binary.Hex;
final byte[] dataToSign = {0xa, 0x2, (byte) 0xff};
final AgentProxy agentProxy = AgentProxies.newInstance();
final List<Identity> identities = agentProxy.list();
for (final Identity identity : identities) {
if (identity.getPublicKey().getAlgorithm().equals("RSA")) {
final byte[] signedData = agentProxy.sign(identity, dataToSign);
System.out.println(Hex.encodeHexString(signedData));
}
}
Any platform that has the following
- Java 7+
- Maven 3 (for compiling)
To cut the Maven release:
mvn clean [-B -Dinvoker.skip -DskipTests -Darguments='-Dinvoker.skip -DskipTests'] \
-Dgpg.keyname=<key ID used for signing artifacts> \
release:clean release:prepare release:perform
This project adheres to the Open Code of Conduct. By participating, you are expected to honor this code.