Class KeyStoreFile
java.lang.Object
org.codice.ddf.security.certificate.generator.KeyStoreFile
Facade class for a Java Keystore (JKS) file. Exposes a few high-level behaviors to abstract away
the complexity of JCA/JCE, as well as file I/O operations.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaliases()Return the aliases of the items in the key store.booleandeleteEntry(String alias) Remove the key store entry at the given alias.Retrieve keystore entry, given the entry's alias.booleanvoidsave()Save the keyStore to the original file and encrypt it with the original password.voidsetEntry(String alias, KeyStore.Entry entry) Add a new entry to the keystore.
-
Field Details
-
keyStore
-
file
-
-
Constructor Details
-
KeyStoreFile
public KeyStoreFile()
-
-
Method Details
-
aliases
Return the aliases of the items in the key store. Return null if there is an error.- Returns:
- List of aliases or throw an exception
-
isKey
-
getEntry
Retrieve keystore entry, given the entry's alias. If the entry is encrypted, this method tries to decrypt it using the keystore's password.- Parameters:
alias- of the entry to retrieve- Returns:
- concrete subclass of Keystore.Entry
-
setEntry
Add a new entry to the keystore. Use the given alias.- Parameters:
alias- of keystore entryentry- instance
-
deleteEntry
Remove the key store entry at the given alias. If the alias does not exist, log that it does not exist.- Parameters:
alias- the name of the entry in the keystore- Returns:
- true if entry is not in the keystore false otherwise
-
save
public void save()Save the keyStore to the original file and encrypt it with the original password.
-