Package org.apache.mina.filter.ssl
Class KeyStoreFactory
- java.lang.Object
-
- org.apache.mina.filter.ssl.KeyStoreFactory
-
public class KeyStoreFactory extends Object
A factory that creates and configures a newKeyStore
instance.- Author:
- Apache MINA Project
-
-
Constructor Summary
Constructors Constructor Description KeyStoreFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KeyStore
newInstance()
Creates a newKeyStore
.void
setData(byte[] data)
Sets the data which contains the key store.void
setDataFile(File dataFile)
Sets the data which contains the key store.void
setDataUrl(URL dataUrl)
Sets the data which contains the key store.void
setPassword(String password)
Sets the key store password.void
setProvider(String provider)
Sets the name of the provider to use when creating the key store.void
setType(String type)
Sets the type of key store to create.
-
-
-
Method Detail
-
newInstance
public KeyStore newInstance() throws KeyStoreException, NoSuchProviderException, NoSuchAlgorithmException, CertificateException, IOException
Creates a newKeyStore
. This method will be called by the base class when Spring creates a bean using this FactoryBean.- Returns:
- a new
KeyStore
instance. - Throws:
KeyStoreException
- If we can't create an instance of the KeyStore for the given typeNoSuchProviderException
- If we don't have the provider registered to create the KeyStoreNoSuchAlgorithmException
- If the KeyStore algorithm cannot be usedCertificateException
- If the KeyStore certificate cannot be loadedIOException
- If the KeyStore cannot be loaded
-
setType
public void setType(String type)
Sets the type of key store to create. The default is to create a JKS key store.- Parameters:
type
- the type to use when creating the key store.- Throws:
IllegalArgumentException
- if the specified value isnull
.
-
setPassword
public void setPassword(String password)
Sets the key store password. If this value isnull
no password will be used to check the integrity of the key store.- Parameters:
password
- the password ornull
if no password is needed.
-
setProvider
public void setProvider(String provider)
Sets the name of the provider to use when creating the key store. The default is to use the platform default provider.- Parameters:
provider
- the name of the provider, e.g. "SUN".
-
setData
public void setData(byte[] data)
Sets the data which contains the key store.- Parameters:
data
- the byte array that contains the key store
-
setDataFile
public void setDataFile(File dataFile) throws IOException
Sets the data which contains the key store.- Parameters:
dataFile
- theFile
that contains the key store- Throws:
IOException
- If we can't process the file
-
setDataUrl
public void setDataUrl(URL dataUrl) throws IOException
Sets the data which contains the key store.- Parameters:
dataUrl
- theURL
that contains the key store.- Throws:
IOException
- If we can't process the URL
-
-