public interface KeyStore
Modifier and Type | Method and Description |
---|---|
boolean |
addKey(com.sshtools.common.ssh.components.SshKeyPair pair,
java.lang.String description,
KeyConstraints cs) |
boolean |
addKey(com.sshtools.common.ssh.components.SshPrivateKey prvkey,
com.sshtools.common.ssh.components.SshPublicKey pubkey,
java.lang.String description,
KeyConstraints cs)
Add a key to this keystore
|
boolean |
deleteAllKeys()
Delete all the keys in this keystore.
|
boolean |
deleteKey(com.sshtools.common.ssh.components.SshPublicKey pubkey)
Delete a key from the keystore.
|
KeyConstraints |
getKeyConstraints(com.sshtools.common.ssh.components.SshPublicKey key)
Get the constraints for a key stored in this keystore.
|
java.util.Map<com.sshtools.common.ssh.components.SshPublicKey,java.lang.String> |
getPublicKeys()
Return a Map of all the installed keys.
|
boolean |
isLocked()
Determine if the store is currently locked.
|
boolean |
lock(java.lang.String password)
Lock the keystore.
|
byte[] |
performHashAndSign(com.sshtools.common.ssh.components.SshPublicKey pubkey,
java.util.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(java.lang.String password)
Unlock the keystore.
|
java.util.Map<com.sshtools.common.ssh.components.SshPublicKey,java.lang.String> getPublicKeys()
KeyConstraints getKeyConstraints(com.sshtools.common.ssh.components.SshPublicKey key)
key
- The public key.int size()
boolean addKey(com.sshtools.common.ssh.components.SshPrivateKey prvkey, com.sshtools.common.ssh.components.SshPublicKey pubkey, java.lang.String description, KeyConstraints cs) throws java.io.IOException
prvkey
- The private keypubkey
- The public keydescription
- A description for this key pair.cs
- Any constraints.true
if the key was added to the keystore.java.io.IOException
boolean addKey(com.sshtools.common.ssh.components.SshKeyPair pair, java.lang.String description, KeyConstraints cs) throws java.io.IOException
java.io.IOException
boolean deleteAllKeys()
byte[] performHashAndSign(com.sshtools.common.ssh.components.SshPublicKey pubkey, java.util.List<ForwardingNotice> forwardingNodes, byte[] data, int flags) throws KeyTimeoutException, com.sshtools.common.ssh.SshException
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.KeyTimeoutException
InvalidSshKeyException
InvalidSshKeySignatureException
com.sshtools.common.ssh.SshException
boolean deleteKey(com.sshtools.common.ssh.components.SshPublicKey pubkey) throws java.io.IOException
pubkey
- The public key to delete.true
if the key was deleted.java.io.IOException
boolean lock(java.lang.String password) throws java.io.IOException
password
- A password to secure the store. Only the same password will unlock the store.true
if the store was locked.java.io.IOException
boolean unlock(java.lang.String password) throws java.io.IOException
password
- The password that was provided when locking the store.true if the store was unlocked.
java.io.IOException
boolean isLocked()
Copyright © 2022. All rights reserved.