Class ModifyTrackingKeyStore

java.lang.Object
java.security.KeyStore
org.wildfly.security.keystore.ModifyTrackingKeyStore

public class ModifyTrackingKeyStore extends KeyStore
A KeyStore implementation that tracks if it's contents have been modified through the API since the last load / save.
Author:
Darran Lofthouse
  • Method Details

    • modifyTrackingKeyStore

      public static ModifyTrackingKeyStore modifyTrackingKeyStore(KeyStore toWrap) throws NoSuchAlgorithmException, CertificateException, IOException
      Wrap an existing initialised KeyStore with a wrapper to track if it is modified.
      Parameters:
      toWrap - the KeyStore to wrap
      Returns:
      the wrapper around the KeyStore
      Throws:
      NoSuchAlgorithmException - if the keystore could not be loaded due to a missing algorithm
      CertificateException - if the keystore could not be loaded due to a certificate problem
      IOException - if the keystore could not be loaded due to an I/O problem
      IllegalArgumentException - if the KeyStore being wrapped is null
    • 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 the KeyStore 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.