public interface KeyStore
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
|
boolean |
deleteAllKeys()
Delete all the keys in this keystore.
|
boolean |
deleteKey(SshPublicKey pubkey)
Delete a key from the keystore.
|
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.
|
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.
|
int |
size()
How many keys are in this store?
|
boolean |
unlock(String password)
Unlock the keystore.
|
Map<SshPublicKey,String> getPublicKeys()
KeyConstraints getKeyConstraints(SshPublicKey key)
key
- The public key.int size()
boolean addKey(SshPrivateKey prvkey, SshPublicKey pubkey, String description, KeyConstraints cs) throws 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.IOException
boolean addKey(SshKeyPair pair, String description, KeyConstraints cs) throws IOException
IOException
boolean deleteAllKeys()
byte[] performHashAndSign(SshPublicKey pubkey, List<ForwardingNotice> forwardingNodes, byte[] data) throws KeyTimeoutException, 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
SshException
boolean deleteKey(SshPublicKey pubkey) throws IOException
pubkey
- The public key to delete.true
if the key was deleted.IOException
boolean lock(String password) throws IOException
password
- A password to secure the store. Only the same password will unlock the store.true
if the store was locked.IOException
boolean unlock(String password) throws IOException
password
- The password that was provided when locking the store.true if the store was unlocked.
IOException
boolean isLocked()
Copyright © 2024. All rights reserved.