Package org.wildfly.security.keystore
Class ModifyTrackingKeyStore
- java.lang.Object
-
- java.security.KeyStore
-
- org.wildfly.security.keystore.ModifyTrackingKeyStore
-
public class ModifyTrackingKeyStore extends KeyStore
AKeyStore
implementation that tracks if it's contents have been modified through the API since the last load / save.- Author:
- Darran Lofthouse
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.security.KeyStore
KeyStore.Builder, KeyStore.CallbackHandlerProtection, KeyStore.Entry, KeyStore.LoadStoreParameter, KeyStore.PasswordProtection, KeyStore.PrivateKeyEntry, KeyStore.ProtectionParameter, KeyStore.SecretKeyEntry, KeyStore.TrustedCertificateEntry
-
-
Field Summary
Fields Modifier and Type Field Description private ModifyTrackingKeyStoreSpi
keyStoreSpi
-
Constructor Summary
Constructors Modifier Constructor Description private
ModifyTrackingKeyStore(ModifyTrackingKeyStoreSpi keyStoreSpi, Provider provider, String type)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isModified()
Identify if the KeyStore has been modified through this implementation since the last call to save or load.static ModifyTrackingKeyStore
modifyTrackingKeyStore(KeyStore toWrap)
Wrap an existing initialisedKeyStore
with a wrapper to track if it is modified.void
setModified(boolean modified)
Mark this as being modified, this can be used where the delegate is delibaratly modified outside this wrapper.-
Methods inherited from class java.security.KeyStore
aliases, containsAlias, deleteEntry, entryInstanceOf, getCertificate, getCertificateAlias, getCertificateChain, getCreationDate, getDefaultType, getEntry, getInstance, getInstance, getInstance, getInstance, getInstance, getKey, getProvider, getType, isCertificateEntry, isKeyEntry, load, load, setCertificateEntry, setEntry, setKeyEntry, setKeyEntry, size, store, store
-
-
-
-
Field Detail
-
keyStoreSpi
private final ModifyTrackingKeyStoreSpi keyStoreSpi
-
-
Constructor Detail
-
ModifyTrackingKeyStore
private ModifyTrackingKeyStore(ModifyTrackingKeyStoreSpi keyStoreSpi, Provider provider, String type)
-
-
Method Detail
-
modifyTrackingKeyStore
public static ModifyTrackingKeyStore modifyTrackingKeyStore(KeyStore toWrap) throws NoSuchAlgorithmException, CertificateException, IOException
Wrap an existing initialisedKeyStore
with a wrapper to track if it is modified.- Parameters:
toWrap
- theKeyStore
to wrap- Returns:
- the wrapper around the
KeyStore
- Throws:
NoSuchAlgorithmException
- if the keystore could not be loaded due to a missing algorithmCertificateException
- if the keystore could not be loaded due to a certificate problemIOException
- if the keystore could not be loaded due to an I/O problemIllegalArgumentException
- if theKeyStore
being wrapped isnull
-
isModified
public boolean isModified()
Identify if the KeyStore has been modified through this implementation since the last call to save or load.- Returns:
true
if theKeyStore
has been modified,false
otherwise.
-
setModified
public void setModified(boolean modified)
Mark this as being modified, this can be used where the delegate is delibaratly modified outside this wrapper.
-
-