public class KeyAgentIdentity extends java.lang.Object implements PublicKeyIdentity
SshAgent
to generate the identity signatureModifier and Type | Field and Description |
---|---|
private SshAgent |
agent |
private java.lang.String |
comment |
private java.security.KeyPair |
keyPair |
private java.security.KeyPair |
resolvedPair |
Constructor and Description |
---|
KeyAgentIdentity(SshAgent agent,
java.security.PublicKey key,
java.lang.String comment) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getComment() |
java.security.KeyPair |
getKeyIdentity() |
java.util.Map.Entry<java.lang.String,byte[]> |
sign(SessionContext session,
java.lang.String algo,
byte[] data)
Proves the public key identity by signing the given data
|
java.lang.String |
toString() |
private final SshAgent agent
private final java.security.KeyPair keyPair
private java.security.KeyPair resolvedPair
private final java.lang.String comment
public KeyAgentIdentity(SshAgent agent, java.security.PublicKey key, java.lang.String comment)
public java.security.KeyPair getKeyIdentity()
getKeyIdentity
in interface PublicKeyIdentity
KeyPair
identity valuepublic java.lang.String getComment()
public java.util.Map.Entry<java.lang.String,byte[]> sign(SessionContext session, java.lang.String algo, byte[] data) throws java.lang.Exception
PublicKeyIdentity
sign
in interface PublicKeyIdentity
session
- The SessionContext
for calling this method - may be null
if not called within a
session contextalgo
- Recommended signature algorithm - if null
/empty then one will be selected based on the
key type and/or signature factories. Note: even if specific algorithm specified, the
implementation may disregard and choose anotherdata
- Data to signjava.lang.Exception
- If failed to sign the datapublic java.lang.String toString()
toString
in class java.lang.Object