public abstract class CryptoStreamFactoryTemplate extends Object implements CryptoStreamFactory
| Modifier and Type | Field and Description |
|---|---|
protected static CryptoStreamFactory |
instance
the default instance
|
| Constructor and Description |
|---|
CryptoStreamFactoryTemplate() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract Cipher |
createCipher(int encryptMode,
char[] password) |
InputStream |
getInputStream(InputStream is)
Creates a decrypting input stream using the default password.
|
InputStream |
getInputStream(InputStream is,
char[] password)
Creates an decrypting input stream using a given password.
|
InputStream |
getInputStream(InputStream is,
String decryptionMode)
Creates input stream based on the decryption mode
using the default password.
|
InputStream |
getInputStream(InputStream is,
String decryptionMode,
char[] password)
Creates input stream based on the decryption mode
using the given password.
|
static CryptoStreamFactory |
getInstance() |
OutputStream |
getOutputStream(OutputStream os)
Creates an encrypting output stream using the default password.
|
OutputStream |
getOutputStream(OutputStream os,
char[] password)
Creates an encrypting output stream using the given password.
|
InputStream |
getSmartInputStream(InputStream is)
Creates a smart decrypting input stream using the default
password.
|
abstract InputStream |
getSmartInputStream(InputStream is,
char[] password)
Creates a smart decrypting input stream using a given
password.
|
static void |
setInstance(CryptoStreamFactory instance) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAlgorithmprotected static CryptoStreamFactory instance
public static CryptoStreamFactory getInstance()
public static void setInstance(CryptoStreamFactory instance)
public InputStream getInputStream(InputStream is, String decryptionMode) throws GeneralSecurityException, IOException
CryptoStreamFactorygetInputStream in interface CryptoStreamFactoryis - the input stream to be wrappeddecryptionMode - the decryption mode (true|false|auto)GeneralSecurityException - creating the input stream failedIOException - creating the input stream failedCryptoStreamFactory.getInputStream(java.io.InputStream, String)public InputStream getInputStream(InputStream is, String decryptionMode, char[] password) throws GeneralSecurityException, IOException
CryptoStreamFactorygetInputStream in interface CryptoStreamFactoryis - the input stream to be wrappeddecryptionMode - the decryption mode (true|false|auto)password - the password to be usedGeneralSecurityException - creating the input stream failedIOException - creating the input stream failedCryptoStreamFactory.getInputStream(java.io.InputStream, String, char[])public InputStream getInputStream(InputStream is) throws GeneralSecurityException, IOException
CryptoStreamFactorygetInputStream in interface CryptoStreamFactoryis - the input stream to be wrappedGeneralSecurityException - creating the input stream failedIOException - creating the input stream failedCryptoStreamFactory.getInputStream(java.io.InputStream)public InputStream getInputStream(InputStream is, char[] password) throws GeneralSecurityException, IOException
CryptoStreamFactorygetInputStream in interface CryptoStreamFactoryis - the input stream to be wrappedpassword - the password to be usedGeneralSecurityException - creating the input stream failedIOException - creating the input stream failedCryptoStreamFactory.getInputStream(java.io.InputStream,char[])public InputStream getSmartInputStream(InputStream is) throws GeneralSecurityException, IOException
CryptoStreamFactorygetSmartInputStream in interface CryptoStreamFactoryis - the input stream to be wrappedGeneralSecurityException - creating the input stream failedIOException - creating the input stream failedCryptoStreamFactory.getSmartInputStream(java.io.InputStream)public abstract InputStream getSmartInputStream(InputStream is, char[] password) throws GeneralSecurityException, IOException
CryptoStreamFactorygetSmartInputStream in interface CryptoStreamFactoryis - 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 OutputStream getOutputStream(OutputStream os) throws GeneralSecurityException, IOException
CryptoStreamFactorygetOutputStream in interface CryptoStreamFactoryos - the output stream to be wrappedGeneralSecurityException - creating the output stream failedIOException - creating the output stream failedCryptoStreamFactory.getOutputStream(java.io.OutputStream)public OutputStream getOutputStream(OutputStream os, char[] password) throws GeneralSecurityException, IOException
CryptoStreamFactorygetOutputStream in interface CryptoStreamFactoryos - the output stream to be wrappedpassword - the password to be usedGeneralSecurityException - creating the output stream failedIOException - creating the output stream failedCryptoStreamFactory.getOutputStream(java.io.OutputStream, char[])protected abstract Cipher createCipher(int encryptMode, char[] password) throws GeneralSecurityException, IOException
GeneralSecurityExceptionIOExceptionCopyright © 2008–2020 The Apache Software Foundation. All rights reserved.