Constructor and Description |
---|
InMemoryKeyStore()
Creates a new KeyStore object.
|
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
|
void |
addKeyStoreListener(KeyStoreListener listener)
Add a listener.
|
boolean |
deleteAllKeys()
Delete all the keys in this keystore.
|
boolean |
deleteKey(com.sshtools.common.ssh.components.SshPublicKey pubkey)
Delete a key from the keystore.
|
com.sshtools.common.ssh.components.SshPublicKey |
elementAt(int i)
Get the public key at the specified index
|
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.
|
int |
indexOf(com.sshtools.common.ssh.components.SshPublicKey key)
Find the index of a key.
|
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.
|
void |
removeKeyStoreListener(KeyStoreListener listener)
Remove a listener.
|
int |
size()
How many keys are in this store?
|
boolean |
unlock(java.lang.String password)
Unlock the keystore.
|
public java.util.Map<com.sshtools.common.ssh.components.SshPublicKey,java.lang.String> getPublicKeys()
KeyStore
getPublicKeys
in interface KeyStore
public int indexOf(com.sshtools.common.ssh.components.SshPublicKey key)
key
- The key to look for.public com.sshtools.common.ssh.components.SshPublicKey elementAt(int i)
i
- The index of the key.public KeyConstraints getKeyConstraints(com.sshtools.common.ssh.components.SshPublicKey key)
KeyStore
getKeyConstraints
in interface KeyStore
key
- The public key.public int size()
KeyStore
public void addKeyStoreListener(KeyStoreListener listener)
listener
- public void removeKeyStoreListener(KeyStoreListener listener)
listener
- public 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
KeyStore
public boolean addKey(com.sshtools.common.ssh.components.SshKeyPair pair, java.lang.String description, KeyConstraints cs) throws java.io.IOException
public boolean deleteAllKeys()
KeyStore
deleteAllKeys
in interface KeyStore
public 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
KeyStore
performHashAndSign
in interface KeyStore
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
com.sshtools.common.ssh.SshException
public boolean deleteKey(com.sshtools.common.ssh.components.SshPublicKey pubkey) throws java.io.IOException
KeyStore
public boolean lock(java.lang.String password) throws java.io.IOException
KeyStore
public boolean unlock(java.lang.String password) throws java.io.IOException
KeyStore
Copyright © 2022. All rights reserved.