Package com.sshtools.agent
Interface KeyStore
- All Known Implementing Classes:
InMemoryKeyStore
public interface KeyStore
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addKey
(com.sshtools.common.ssh.components.SshKeyPair pair, String description, KeyConstraints cs) boolean
addKey
(com.sshtools.common.ssh.components.SshPrivateKey prvkey, com.sshtools.common.ssh.components.SshPublicKey pubkey, String description, KeyConstraints cs) Add a key to this keystoreboolean
Delete all the keys in this keystore.boolean
deleteKey
(com.sshtools.common.ssh.components.SshPublicKey pubkey) Delete a key from the keystore.getKeyConstraints
(com.sshtools.common.ssh.components.SshPublicKey key) Get the constraints for a key stored in this keystore.Return a Map of all the installed keys.boolean
isLocked()
Determine if the store is currently locked.boolean
Lock the keystore.byte[]
performHashAndSign
(com.sshtools.common.ssh.components.SshPublicKey pubkey, List<ForwardingNotice> forwardingNodes, byte[] data, int flags) Hash and sign some data using a key stored in this keystore.int
size()
How many keys are in this store?boolean
Unlock the keystore.
-
Method Details
-
getPublicKeys
Return a Map of all the installed keys.- Returns:
-
getKeyConstraints
Get the constraints for a key stored in this keystore.- Parameters:
key
- The public key.- Returns:
-
size
int size()How many keys are in this store?- Returns:
- The number of keys in this store.
-
addKey
boolean addKey(com.sshtools.common.ssh.components.SshPrivateKey prvkey, com.sshtools.common.ssh.components.SshPublicKey pubkey, String description, KeyConstraints cs) throws IOException Add a key to this keystore- Parameters:
prvkey
- The private keypubkey
- The public keydescription
- A description for this key pair.cs
- Any constraints.- Returns:
true
if the key was added to the keystore.- Throws:
IOException
-
addKey
boolean addKey(com.sshtools.common.ssh.components.SshKeyPair pair, String description, KeyConstraints cs) throws IOException - Throws:
IOException
-
deleteAllKeys
boolean deleteAllKeys()Delete all the keys in this keystore. -
performHashAndSign
byte[] performHashAndSign(com.sshtools.common.ssh.components.SshPublicKey pubkey, List<ForwardingNotice> forwardingNodes, byte[] data, int flags) throws KeyTimeoutException, com.sshtools.common.ssh.SshException Hash and sign some data using a key stored in this keystore.- Parameters:
pubkey
- The public key for which the signing should be untaken.forwardingNodes
- A list of forwarding notices for this operation.data
- The data to sign.- Returns:
- Throws:
KeyTimeoutException
InvalidSshKeyException
InvalidSshKeySignatureException
com.sshtools.common.ssh.SshException
-
deleteKey
Delete a key from the keystore.- Parameters:
pubkey
- The public key to delete.- Returns:
true
if the key was deleted.- Throws:
IOException
-
lock
Lock the keystore.- Parameters:
password
- A password to secure the store. Only the same password will unlock the store.- Returns:
true
if the store was locked.- Throws:
IOException
-
unlock
Unlock the keystore.- Parameters:
password
- The password that was provided when locking the store.- Returns:
true if the store was unlocked.
- Throws:
IOException
-
isLocked
boolean isLocked()Determine if the store is currently locked.- Returns:
-