|
Apache JMeter | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jmeter.util.keystore.JmeterKeyStore
public final class JmeterKeyStore
Use this Keystore for JMeter specific KeyStores.
Method Summary | |
---|---|
String |
getAlias()
Get the next or only alias. |
String |
getAlias(int index)
|
int |
getAliasCount()
|
X509Certificate[] |
getCertificateChain(String alias)
Get the ordered certificate chain for a specific alias. |
String[] |
getClientAliases(String keyType,
Principal[] issuers)
Compiles the list of all client aliases with a private key. |
static JmeterKeyStore |
getInstance(String type)
Create a keystore which returns the first alias only. |
static JmeterKeyStore |
getInstance(String type,
int startIndex,
int endIndex,
String clientCertAliasVarName)
Create a keystore which returns a range of aliases (if available) |
PrivateKey |
getPrivateKey(String alias)
Return the private Key for a specific alias |
void |
load(InputStream is,
String pword)
Process the input stream and try to read the keys from the store |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void load(InputStream is, String pword) throws NoSuchAlgorithmException, CertificateException, IOException, KeyStoreException, UnrecoverableKeyException
is
- InputStream
from which the store should be loadedpword
- the password used to check the integrity of the store
IOException
- if there is a problem decoding or reading the store. A bad
password might be the cause for this, or an empty store
CertificateException
- if any of the certificated in the store can not be loaded
NoSuchAlgorithmException
- if the algorithm to check the integrity of the store can not
be found
KeyStoreException
- if the store has not been initialized (should not happen
here)
UnrecoverableKeyException
- if the key can not be recovered from the store (should not
happen here, either)public X509Certificate[] getCertificateChain(String alias)
alias
- the alias for which the certificate chain should be given
IllegalArgumentException
- if no chain could be found for the aliaspublic String getAlias()
IllegalArgumentException
- if clientCertAliasVarName
is not empty and no key for this
alias could be foundpublic int getAliasCount()
public String getAlias(int index)
public PrivateKey getPrivateKey(String alias)
alias
- the name of the alias for the private key
alias
IllegalArgumentException
- when no private key could be foundpublic static JmeterKeyStore getInstance(String type, int startIndex, int endIndex, String clientCertAliasVarName) throws KeyStoreException
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
KeyStoreException
- when the type of the store is not supported
IllegalArgumentException
- when startIndex
< 0, endIndex
< 0, or endIndex
< startIndex
public static JmeterKeyStore getInstance(String type) throws KeyStoreException
type
- of the store e.g. JKS
KeyStoreException
- when the type of the store is not supportedpublic String[] getClientAliases(String keyType, Principal[] issuers)
keyType
- the key algorithm type name (RSA, DSA, etc.)issuers
- the CA certificates we are narrowing our selection on.
|
Apache JMeter | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |