Class KeyStores

java.lang.Object
net.sourceforge.jnlp.security.KeyStores

public final class KeyStores extends Object
The KeyStores class allows easily accessing the various KeyStores used.
  • Field Details

  • Constructor Details

    • KeyStores

      public KeyStores()
  • Method Details

    • getKeyStore

      public static final KeyStores.KeyStoreWithPath getKeyStore(KeyStores.Level level, KeyStores.Type type)
      Returns a KeyStore corresponding to the appropriate level level (user or system) and type.
      Parameters:
      level - whether the KeyStore desired is a user-level or system-level KeyStore
      type - the type of KeyStore desired
      Returns:
      a KeyStore containing certificates from the appropriate
    • getPathToKeystore

      public static String getPathToKeystore(int k)
    • getCertKeyStores

      public static final KeyStore[] getCertKeyStores()
      Returns an array of KeyStore that contain certificates that are trusted. The KeyStores contain certificates from different sources.
      Returns:
      an array of KeyStore containing trusted Certificates
    • getCAKeyStores

      public static final KeyStore[] getCAKeyStores()
      Returns an array of KeyStore that contain trusted CA certificates.
      Returns:
      an array of KeyStore containing trusted CA certificates
    • getClientKeyStores

      public static KeyStore[] getClientKeyStores()
      Returns KeyStores containing trusted client certificates
      Returns:
      an array of KeyStore objects that can be used to check client authentication certificates
    • getKeyStoreLocation

      public static final InfrastructureFileDescriptor getKeyStoreLocation(KeyStores.Level level, KeyStores.Type type)
      Returns the location of a KeyStore corresponding to the given level and type.
      Parameters:
      level - the specified level of the key store to be returned.
      type - the specified type of the key store to be returned.
      Returns:
      the location of the key store.
    • toTranslatableString

      public static final String toTranslatableString(KeyStores.Level level, KeyStores.Type type)
      Returns a String that can be used as a translation key to create a user-visible representation of this KeyStore. Creates a string by concatenating a level and type, converting everything to Title Case and removing the _'s. (USER,CA_CERTS) becomes UserCaCerts.
      Parameters:
      level - the level of the key store.
      type - the type of the key store.
      Returns:
      the translation key.
    • toDisplayableString

      public static String toDisplayableString(KeyStores.Level level, KeyStores.Type type)
      Returns a human readable name for this KeyStore
      Parameters:
      level - the level of the KeyStore
      type - the type of KeyStore
      Returns:
      a localized name for this KeyStore