public class CryptoStreamFactoryImpl extends CryptoStreamFactoryTemplate implements CryptoStreamFactory
| Modifier and Type | Field and Description |
|---|---|
protected String |
algorithm
the algorithm to use
|
protected int |
count
the count paramter for the PBE algorithm
|
protected String |
providerName
the name of the JCE provider
|
protected static String |
PROVIDERNAME
The JCE provider name known to work.
|
protected byte[] |
salt
the salt for the PBE algorithm
|
| Constructor and Description |
|---|
CryptoStreamFactoryImpl()
Constructor
|
CryptoStreamFactoryImpl(byte[] salt,
int count)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected Cipher |
createCipher(int mode,
char[] password)
Create a Cipher.
|
protected Key |
createKey(char[] password)
Create a PBE key.
|
String |
getAlgorithm()
Info about used algorithm.
|
protected int |
getCount() |
static CryptoStreamFactory |
getInstance()
Factory method to get a default instance
|
static CryptoStreamFactory |
getInstance(byte[] salt,
int count)
Factory method to get a default instance
|
protected String |
getProviderName() |
protected byte[] |
getSalt() |
InputStream |
getSmartInputStream(InputStream is,
char[] password)
Creates a smart decrypting input stream using a given
password.
|
static void |
setInstance(CryptoStreamFactory instance)
Set the default instance from an external application.
|
getInputStream, getInputStream, getInputStream, getInputStream, getOutputStream, getOutputStream, getSmartInputStreamclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetInputStream, getInputStream, getInputStream, getInputStream, getOutputStream, getOutputStream, getSmartInputStreamprotected final byte[] salt
protected int count
protected String providerName
protected String algorithm
protected static final String PROVIDERNAME
public CryptoStreamFactoryImpl()
public CryptoStreamFactoryImpl(byte[] salt,
int count)
salt - the salt for the PBE algorithmcount - the iteration for PBEParameterSpecpublic static CryptoStreamFactory getInstance()
public static void setInstance(CryptoStreamFactory instance)
instance - the new default instancepublic static CryptoStreamFactory getInstance(byte[] salt, int count)
salt - the salt for the PBE algorithmcount - the iteration for PBEParameterSpecpublic InputStream getSmartInputStream(InputStream is, char[] password) throws GeneralSecurityException, IOException
CryptoStreamFactorygetSmartInputStream in interface CryptoStreamFactorygetSmartInputStream in class CryptoStreamFactoryTemplateis - the input stream to be wrappedpassword - the password to be usedGeneralSecurityException - creating the input stream failedIOException - creating the input stream failedCryptoStreamFactory.getSmartInputStream(java.io.InputStream,char[])public String getAlgorithm()
CryptoStreamFactorygetAlgorithm in interface CryptoStreamFactoryprotected int getCount()
protected String getProviderName()
protected byte[] getSalt()
protected Key createKey(char[] password) throws GeneralSecurityException
password - the password to use.GeneralSecurityException - creating the key failedprotected Cipher createCipher(int mode, char[] password) throws GeneralSecurityException, IOException
createCipher in class CryptoStreamFactoryTemplatemode - the cipher modepassword - the passwordGeneralSecurityException - creating a cipher failedIOException - creating a cipher failedCopyright © 2008–2020 The Apache Software Foundation. All rights reserved.