| 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()
KeyStoregetPublicKeys in interface KeyStorepublic 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)
KeyStoregetKeyConstraints in interface KeyStorekey - The public key.public int size()
KeyStorepublic void addKeyStoreListener(KeyStoreListener listener)
listener - public void removeKeyStoreListener(KeyStoreListener listener)
listener - public boolean addKey(SshPrivateKey prvkey, SshPublicKey pubkey, String description, KeyConstraints cs) throws IOException
KeyStoreaddKey in interface KeyStoreprvkey - The private keypubkey - The public keydescription - A description for this key pair.cs - Any constraints.true if the key was added to the keystore.IOExceptionpublic boolean addKey(SshKeyPair pair, String description, KeyConstraints cs) throws IOException
addKey in interface KeyStoreIOExceptionpublic boolean deleteAllKeys()
KeyStoredeleteAllKeys in interface KeyStorepublic byte[] performHashAndSign(SshPublicKey pubkey, List<ForwardingNotice> forwardingNodes, byte[] data) throws KeyTimeoutException, SshException
KeyStoreperformHashAndSign in interface KeyStorepubkey - The public key for which the signing should be untaken.forwardingNodes - A list of forwarding notices for this operation.data - The data to sign.KeyTimeoutExceptionSshExceptionpublic boolean deleteKey(SshPublicKey pubkey) throws IOException
KeyStoredeleteKey in interface KeyStorepubkey - The public key to delete.true if the key was deleted.IOExceptionpublic boolean lock(String password) throws IOException
KeyStorelock in interface KeyStorepassword - A password to secure the store. Only the same password will unlock the store.true if the store was locked.IOExceptionpublic boolean unlock(String password) throws IOException
KeyStoreunlock in interface KeyStorepassword - The password that was provided when locking the store.true if the store was unlocked.IOExceptionCopyright © 2025. All rights reserved.