Class JmeterKeyStore


  • public final class JmeterKeyStore
    extends Object
    Use this Keystore for JMeter specific KeyStores.
    • Method Detail

      • getCertificateChain

        public X509Certificate[] getCertificateChain​(String alias)
        Get the ordered certificate chain for a specific alias.
        Parameters:
        alias - the alias for which the certificate chain should be given
        Returns:
        the certificate chain for the alias
        Throws:
        IllegalArgumentException - if no chain could be found for the alias
      • getAliasCount

        public int getAliasCount()
      • getAlias

        public String getAlias​(int index)
      • getPrivateKey

        public PrivateKey getPrivateKey​(String alias)
        Return the private Key for a specific alias
        Parameters:
        alias - the name of the alias for the private key
        Returns:
        the private key for the given alias
        Throws:
        IllegalArgumentException - when no private key could be found
      • getInstance

        public static JmeterKeyStore getInstance​(String type,
                                                 int startIndex,
                                                 int endIndex,
                                                 String clientCertAliasVarName)
                                          throws KeyStoreException
        Create a keystore which returns a range of aliases (if available)
        Parameters:
        type - store type (e.g. JKS)
        startIndex - first index (from 0)
        endIndex - last index (to count -1)
        clientCertAliasVarName - name of the default key to, if empty the first key will be used as default key
        Returns:
        the keystore
        Throws:
        KeyStoreException - when the type of the store is not supported
        IllegalArgumentException - when startIndex < 0, endIndex < 0, or endIndex < startIndex
      • getInstance

        public static JmeterKeyStore getInstance​(String type)
                                          throws KeyStoreException
        Create a keystore which returns the first alias only.
        Parameters:
        type - of the store e.g. JKS
        Returns:
        the keystore
        Throws:
        KeyStoreException - when the type of the store is not supported
      • getClientAliases

        public String[] getClientAliases​(String keyType,
                                         Principal[] issuers)
        Compiles the list of all client aliases with a private key. TODO Currently, keyType and issuers are both ignored.
        Parameters:
        keyType - the key algorithm type name (RSA, DSA, etc.)
        issuers - the CA certificates we are narrowing our selection on.
        Returns:
        the array of aliases; may be empty