Class KeyStoreFactory
java.lang.Object
org.apache.mina.filter.ssl.KeyStoreFactory
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a newKeyStore.voidsetData(byte[] data) Sets the data which contains the key store.private voidsetData(InputStream dataStream) Sets the data which contains the key store.voidsetDataFile(File dataFile) Sets the data which contains the key store.voidsetDataUrl(URL dataUrl) Sets the data which contains the key store.voidsetPassword(String password) Sets the key store password.voidsetProvider(String provider) Sets the name of the provider to use when creating the key store.voidSets the type of key store to create.
-
Field Details
-
type
-
provider
-
password
private char[] password -
data
private byte[] data
-
-
Constructor Details
-
KeyStoreFactory
public KeyStoreFactory()
-
-
Method Details
-
newInstance
public KeyStore newInstance() throws KeyStoreException, NoSuchProviderException, NoSuchAlgorithmException, CertificateException, IOExceptionCreates a newKeyStore. This method will be called by the base class when Spring creates a bean using this FactoryBean.- Returns:
- a new
KeyStoreinstance. - 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
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
Sets the key store password. If this value isnullno password will be used to check the integrity of the key store.- Parameters:
password- the password ornullif no password is needed.
-
setProvider
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
-
setData
Sets the data which contains the key store.- Parameters:
dataStream- theInputStreamthat contains the key store- Throws:
IOException- If we can't process the stream
-
setDataFile
Sets the data which contains the key store.- Parameters:
dataFile- theFilethat contains the key store- Throws:
IOException- If we can't process the file
-
setDataUrl
Sets the data which contains the key store.- Parameters:
dataUrl- theURLthat contains the key store.- Throws:
IOException- If we can't process the URL
-