Constructor and Description |
---|
InMemoryKeyStore()
Creates a new KeyStore object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addKey(SshKeyPair pair,
String description,
KeyConstraints cs) |
boolean |
addKey(SshPrivateKey prvkey,
SshPublicKey pubkey,
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(SshPublicKey pubkey)
Delete a key from the keystore.
|
SshPublicKey |
elementAt(int i)
Get the public key at the specified index
|
KeyConstraints |
getKeyConstraints(SshPublicKey key)
Get the constraints for a key stored in this keystore.
|
Map<SshPublicKey,String> |
getPublicKeys()
Return a Map of all the installed keys.
|
int |
indexOf(SshPublicKey key)
Find the index of a key.
|
boolean |
isLocked()
Determine if the store is currently locked.
|
boolean |
lock(String password)
Lock the keystore.
|
byte[] |
performHashAndSign(SshPublicKey pubkey,
List<ForwardingNotice> forwardingNodes,
byte[] data)
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(String password)
Unlock the keystore.
|
public Map<SshPublicKey,String> getPublicKeys()
KeyStore
getPublicKeys
in interface KeyStore
public int indexOf(SshPublicKey key)
key
- The key to look for.public SshPublicKey elementAt(int i)
i
- The index of the key.public KeyConstraints getKeyConstraints(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(SshPrivateKey prvkey, SshPublicKey pubkey, String description, KeyConstraints cs) throws IOException
KeyStore
addKey
in interface KeyStore
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.IOException
public boolean addKey(SshKeyPair pair, String description, KeyConstraints cs) throws IOException
addKey
in interface KeyStore
IOException
public boolean deleteAllKeys()
KeyStore
deleteAllKeys
in interface KeyStore
public byte[] performHashAndSign(SshPublicKey pubkey, List<ForwardingNotice> forwardingNodes, byte[] data) throws KeyTimeoutException, 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
SshException
public boolean deleteKey(SshPublicKey pubkey) throws IOException
KeyStore
deleteKey
in interface KeyStore
pubkey
- The public key to delete.true
if the key was deleted.IOException
public boolean lock(String password) throws IOException
KeyStore
lock
in interface KeyStore
password
- A password to secure the store. Only the same password will unlock the store.true
if the store was locked.IOException
public boolean unlock(String password) throws IOException
KeyStore
unlock
in interface KeyStore
password
- The password that was provided when locking the store.true if the store was unlocked.
IOException
Copyright © 2024. All rights reserved.