public abstract class MyKeyStore
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULTKEYSTORETYPE |
static java.lang.String |
RESOURCETPYE |
static java.lang.String |
SUFFIX |
| Modifier and Type | Method and Description |
|---|---|
static java.security.KeyStore |
getKeyStore(java.lang.Class<?> clazz)
Gets a KeyStore object of the default keystore type.
|
static java.security.KeyStore |
getKeyStore(java.lang.Class<?> clazz,
char[] storePassword)
Gets a KeyStore object of the default keystore type.
|
static java.security.KeyStore |
getKeyStore(java.lang.Class<?> clazz,
java.lang.String keyStoreType)
Gets a KeyStore object of the given keystore type.
|
static java.security.KeyStore |
getKeyStore(java.lang.Class<?> clazz,
java.lang.String keyStoreType,
char[] storePassword)
Gets a KeyStore object of the given keystore type.
|
static java.security.KeyStore |
getKeyStore(java.lang.String user)
Gets a keystore object for a keystore of the default keystore type for the named user.
|
static java.security.KeyStore |
getKeyStore(java.lang.String user,
char[] storePassword)
Gets a keystore object for a keystore of the named keystore type for the named user.
|
static java.security.KeyStore |
getKeyStore(java.lang.String user,
java.lang.String keyStoreType)
Gets a keystore object for a keystore of the named keystore type for the named user.
|
static java.security.KeyStore |
getKeyStore(java.lang.String user,
java.lang.String keyStoreType,
char[] storePassword)
Gets a keystore object for a keystore of the named keystore type for the named user.
|
static java.io.InputStream |
getKeyStoreInputStream(java.lang.Class<?> clazz)
Gets an InputStream for reading a resource corresponding to the given class.
|
static java.io.InputStream |
getKeyStoreInputStream(java.lang.String user)
Gets an InputStream for reading a keystore resource corresponding to the named user.
|
static java.security.KeyStore |
getPackageKeyStore(java.lang.Class<?> clazz)
Gets a KeyStore object of the default keystore type.
|
static java.security.KeyStore |
getPackageKeyStore(java.lang.Class<?> clazz,
char[] storePassword)
Gets a KeyStore object of the default keystore type.
|
static java.security.KeyStore |
getPackageKeyStore(java.lang.Class<?> clazz,
java.lang.String keyStoreType)
Gets a KeyStore object of the given keystore type.
|
static java.security.KeyStore |
getPackageKeyStore(java.lang.Class<?> clazz,
java.lang.String keyStoreType,
char[] storePassword)
Gets a KeyStore object of the given keystore type.
|
static java.io.InputStream |
getPackageKeyStoreInputStream(java.lang.Class<?> clazz)
Gets an InputStream for reading a resource corresponding to the package of the given class.
|
public static final java.lang.String RESOURCETPYE
public static final java.lang.String SUFFIX
public static final java.lang.String DEFAULTKEYSTORETYPE
public static java.security.KeyStore getKeyStore(java.lang.Class<?> clazz)
throws java.security.KeyStoreException,
NotFoundException,
java.io.IOException,
java.security.NoSuchAlgorithmException,
java.security.cert.CertificateException
clazz - The class of the object for which a keystore is to be found. The name of the resource that will be searched for is the full classname, followed by the SUFFIX constant.java.security.KeyStoreException - if problems with the KeyStore occurredNotFoundException - If no resource of the indicated name could be foundjava.io.IOException - if an I/O exception occurredjava.security.NoSuchAlgorithmException - if the algorithm is unsupportedjava.security.cert.CertificateException - if problems with an involved Certificate were detectedpublic static java.security.KeyStore getKeyStore(java.lang.Class<?> clazz,
char[] storePassword)
throws java.security.KeyStoreException,
NotFoundException,
java.io.IOException,
java.security.NoSuchAlgorithmException,
java.security.cert.CertificateException
clazz - The class of the object for which a keystore is to be found. The name of the resource that will be searched for is the full classname, followed by the SUFFIX constant.storePassword - The password for loading the Storejava.security.KeyStoreException - if problems with the KeyStore occurredNotFoundException - If no resource of the indicated name could be foundjava.io.IOException - if an I/O exception occurredjava.security.NoSuchAlgorithmException - if the algorithm is unsupportedjava.security.cert.CertificateException - if problems with an involved Certificate were detectedpublic static java.security.KeyStore getKeyStore(java.lang.Class<?> clazz,
java.lang.String keyStoreType)
throws java.security.KeyStoreException,
NotFoundException,
java.io.IOException,
java.security.NoSuchAlgorithmException,
java.security.cert.CertificateException
clazz - The class of the object for which a keystore is to be found. The name of the resource that will be searched for is the full classname, followed by the SUFFIX constant.keyStoreType - The name of the KeyStore type to be returned to the callerjava.security.KeyStoreException - if problems with the KeyStore occurredNotFoundException - If no resource of the indicated name could be foundjava.io.IOException - if an I/O exception occurredjava.security.NoSuchAlgorithmException - if the algorithm is unsupportedjava.security.cert.CertificateException - if problems with an involved Certificate were detectedpublic static java.security.KeyStore getKeyStore(java.lang.Class<?> clazz,
java.lang.String keyStoreType,
char[] storePassword)
throws java.security.KeyStoreException,
NotFoundException,
java.io.IOException,
java.security.NoSuchAlgorithmException,
java.security.cert.CertificateException
clazz - The class of the object for which a keystore is to be found. The name of the resource that will be searched for is the full classname, followed by the SUFFIX constant.keyStoreType - The name of the KeyStore type to be returned to the callerstorePassword - The password for loading the storejava.security.KeyStoreException - if problems with the KeyStore occurredNotFoundException - If no resource of the indicated name could be foundjava.io.IOException - if an I/O exception occurredjava.security.NoSuchAlgorithmException - if the algorithm is unsupportedjava.security.cert.CertificateException - if problems with an involved Certificate were detectedpublic static java.security.KeyStore getKeyStore(java.lang.String user)
throws java.security.KeyStoreException,
java.security.NoSuchAlgorithmException,
java.security.cert.CertificateException,
java.io.IOException,
NotFoundException
user - The user whose keystore is to be obtainedjava.security.KeyStoreException - if problems with the KeyStore occurredjava.io.IOException - if an I/O exception occurredjava.security.cert.CertificateException - if problems with an involved Certificate were detectedjava.security.NoSuchAlgorithmException - if the algorithm is unsupportedNotFoundException - If no resource of the indicated name could be foundpublic static java.security.KeyStore getKeyStore(java.lang.String user,
char[] storePassword)
throws java.security.KeyStoreException,
java.security.NoSuchAlgorithmException,
java.security.cert.CertificateException,
java.io.IOException,
NotFoundException
user - The user whose keystore is to be obtainedstorePassword - the password to be provided for opening the keystorejava.security.KeyStoreException - if problems with the KeyStore occurredjava.io.IOException - if an I/O exception occurredjava.security.cert.CertificateException - if problems with an involved Certificate were detectedjava.security.NoSuchAlgorithmException - if the algorithm is unsupportedNotFoundException - If no resource of the indicated name could be foundpublic static java.security.KeyStore getKeyStore(java.lang.String user,
java.lang.String keyStoreType)
throws java.security.KeyStoreException,
java.security.NoSuchAlgorithmException,
java.security.cert.CertificateException,
java.io.IOException,
NotFoundException
user - The user whose keystore is to be obtainedkeyStoreType - The keystore typejava.security.KeyStoreException - if problems with the KeyStore occurredjava.io.IOException - if an I/O exception occurredjava.security.cert.CertificateException - if problems with an involved Certificate were detectedjava.security.NoSuchAlgorithmException - if the algorithm is unsupportedNotFoundException - If no resource of the indicated name could be foundpublic static java.security.KeyStore getKeyStore(java.lang.String user,
java.lang.String keyStoreType,
char[] storePassword)
throws java.security.KeyStoreException,
java.security.NoSuchAlgorithmException,
java.security.cert.CertificateException,
java.io.IOException,
NotFoundException
user - The user whose keystore is to be obtainedkeyStoreType - The keystore typestorePassword - the password to be provided for opening the keystorejava.security.KeyStoreException - if problems with the KeyStore occurredjava.io.IOException - if an I/O exception occurredjava.security.cert.CertificateException - if problems with an involved Certificate were detectedjava.security.NoSuchAlgorithmException - if the algorithm is unsupportedNotFoundException - If no resource of the indicated name could be found If no keystore file for this user could be foundpublic static java.io.InputStream getKeyStoreInputStream(java.lang.Class<?> clazz)
throws NotFoundException
clazz - The class of the object for which a keystore is to be found. The name of the resource that will be searched for is the full classname, followed by the SUFFIX constant.NotFoundException - If no resource of the indicated name could be foundpublic static java.io.InputStream getKeyStoreInputStream(java.lang.String user)
throws NotFoundException
user - The user for which a keystore input stream is to be returnedNotFoundException - If no resource of the indicated name could be foundpublic static java.security.KeyStore getPackageKeyStore(java.lang.Class<?> clazz)
throws java.security.KeyStoreException,
NotFoundException,
java.io.IOException,
java.security.NoSuchAlgorithmException,
java.security.cert.CertificateException
clazz - The class of the object for which a keystore is to be found. The name of the resource that will be searched for is the full packagename, followed by the SUFFIX constant.java.security.KeyStoreException - if problems with the KeyStore occurredNotFoundException - If no resource of the indicated name could be foundjava.io.IOException - if an I/O exception occurredjava.security.NoSuchAlgorithmException - if the algorithm is unsupportedjava.security.cert.CertificateException - if problems with an involved Certificate were detectedpublic static java.security.KeyStore getPackageKeyStore(java.lang.Class<?> clazz,
char[] storePassword)
throws java.security.KeyStoreException,
NotFoundException,
java.io.IOException,
java.security.NoSuchAlgorithmException,
java.security.cert.CertificateException
clazz - The class of the object for which a keystore is to be found. The name of the resource that will be searched for is the full packagename, followed by the SUFFIX constant.storePassword - The password for loading the storejava.security.KeyStoreException - if problems with the KeyStore occurredNotFoundException - If no resource of the indicated name could be foundjava.io.IOException - if an I/O exception occurredjava.security.NoSuchAlgorithmException - if the algorithm is unsupportedjava.security.cert.CertificateException - if problems with an involved Certificate were detectedpublic static java.security.KeyStore getPackageKeyStore(java.lang.Class<?> clazz,
java.lang.String keyStoreType)
throws java.security.KeyStoreException,
NotFoundException,
java.io.IOException,
java.security.NoSuchAlgorithmException,
java.security.cert.CertificateException
clazz - The class of the object for which a keystore is to be found. The name of the resource that will be searched for is the full packagename, followed by the SUFFIX constant.keyStoreType - The name of the KeyStore type to be returned to the callerjava.security.KeyStoreException - if problems with the KeyStore occurredNotFoundException - If no resource of the indicated name could be foundjava.io.IOException - if an I/O exception occurredjava.security.NoSuchAlgorithmException - if the algorithm is unsupportedjava.security.cert.CertificateException - if problems with an involved Certificate were detectedpublic static java.security.KeyStore getPackageKeyStore(java.lang.Class<?> clazz,
java.lang.String keyStoreType,
char[] storePassword)
throws java.security.KeyStoreException,
NotFoundException,
java.io.IOException,
java.security.NoSuchAlgorithmException,
java.security.cert.CertificateException
clazz - The class of the object for which a keystore is to be found. The name of the resource that will be searched for is the full packagename, followed by the SUFFIX constant.keyStoreType - The name of the KeyStore type to be returned to the callerstorePassword - The password for loading the storejava.security.KeyStoreException - if problems with the KeyStore occurredNotFoundException - If no resource of the indicated name could be foundjava.io.IOException - if an I/O exception occurredjava.security.NoSuchAlgorithmException - if the algorithm is unsupportedjava.security.cert.CertificateException - if problems with an involved Certificate were detectedpublic static java.io.InputStream getPackageKeyStoreInputStream(java.lang.Class<?> clazz)
throws NotFoundException
clazz - The class of the object for which a keystore is to be found. The name of the resource that will be searched for is the full classname, followed by the SUFFIX constant.NotFoundException - If no resource of the indicated name could be found