|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.util.test.security.KeyStoreTestHelper
public final class KeyStoreTestHelper
Helper to read a key store and make its keys and certificates easily accessible.
Method Summary | |
---|---|
static KeyStoreTestHelper |
createFromClassPath(Class<?> referenceType, String name, String type, char[] password) Creates an instance of the key store helper read from the class path. |
static KeyStoreTestHelper |
createFromClassPath(ClassLoader classLoader, String name, String type, char[] password) Creates an instance of the key store helper read from the class path. |
static KeyStoreTestHelper |
createFromClassPathRelative(Class<?> referenceType, String relativeName, String type, char[] password) Creates an instance of the key store helper read from the class path. |
static KeyStoreTestHelper |
createFromStream(InputStream input, String type, char[] password) Creates an instance of the key store helper read from the class path. |
KeyStore |
getKeyStore() Returns the test key store. |
Certificate |
readCertificate(String alias) Reads the certificate from the key store. |
PrivateKey |
readPrivateKey(String alias, char[] password) Reads the private key from the key store. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public KeyStore getKeyStore()
public static KeyStoreTestHelper createFromClassPath(ClassLoader classLoader, String name, String type, char[] password) throws IllegalArgumentException
classLoader
- the class loader to locate the key store specified by
name
.
name
- the name of the key store to be read from the class path.
type
- the type of the key store to be read.
password
- the password to access the key store.
IllegalArgumentException
- if the key store cannot be read with the information given.
public static KeyStoreTestHelper createFromClassPath(Class<?> referenceType, String name, String type, char[] password) throws IllegalArgumentException
referenceType
- the type whose class loader is to be used to locate the key store specified by
name
.
name
- the name of the key store to be read from the class path.
type
- the type of the key store to be read.
password
- the password to access the key store.
IllegalArgumentException
- if the key store cannot be read with the information given.
public static KeyStoreTestHelper createFromClassPathRelative(Class<?> referenceType, String relativeName, String type, char[] password) throws IllegalArgumentException
referenceType
- the type whose class loader is to be used to locate the key store specified by
relativeName
.
relativeName
- the relative name of the key store to be read from the class path.
type
- the type of the key store to be read.
password
- the password to access the key store.
IllegalArgumentException
- if the key store cannot be read with the information given.
public static KeyStoreTestHelper createFromStream(InputStream input, String type, char[] password) throws IllegalArgumentException
input
- the stream to read the key store from.
type
- the type of the key store to be read.
password
- the password to access the key store.
IllegalArgumentException
- if the key store cannot be read with the information given.
public PrivateKey readPrivateKey(String alias, char[] password) throws IllegalArgumentException
alias
- the alias of the private key.
password
- the password to access the private key.
IllegalArgumentException
- if the information is not sufficient to access the private key.
public Certificate readCertificate(String alias) throws IllegalArgumentException
alias
- the alias of the certificate.
IllegalArgumentException
- if the certificate cannot be read from the key store.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |