Package org.apache.fulcrum.jce.crypto
Interface CryptoStreamFactory
-
- All Known Subinterfaces:
CryptoStreamFactoryJ8
- All Known Implementing Classes:
CryptoStreamFactoryImpl
,CryptoStreamFactoryJ8Template
,CryptoStreamFactoryTemplate
,CryptoStreamGCMImpl
,CryptoStreamPBEImpl
public interface CryptoStreamFactory
Interface for creating encrypting/decrypting streams.- Author:
- Siegfried Goeschl
-
-
Method Summary
Modifier and Type Method Description String
getAlgorithm()
Info about used algorithm.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.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.InputStream
getSmartInputStream(InputStream is, char[] password)
Creates a smart decrypting input stream using a given password.
-
-
-
Method Detail
-
getInputStream
InputStream getInputStream(InputStream is, String decryptionMode) throws GeneralSecurityException, IOException
Creates input stream based on the decryption mode using the default password.- Parameters:
is
- the input stream to be wrappeddecryptionMode
- the decryption mode (true|false|auto)- Returns:
- an decrypting input stream
- Throws:
GeneralSecurityException
- creating the input stream failedIOException
- creating the input stream failed
-
getInputStream
InputStream getInputStream(InputStream is, String decryptionMode, char[] password) throws GeneralSecurityException, IOException
Creates input stream based on the decryption mode using the given password.- Parameters:
is
- the input stream to be wrappeddecryptionMode
- the decryption mode (true|false|auto)password
- the password to be used- Returns:
- an decrypting input stream
- Throws:
GeneralSecurityException
- creating the input stream failedIOException
- creating the input stream failed
-
getInputStream
InputStream getInputStream(InputStream is) throws GeneralSecurityException, IOException
Creates a decrypting input stream using the default password.- Parameters:
is
- the input stream to be wrapped- Returns:
- an decrypting input stream
- Throws:
GeneralSecurityException
- creating the input stream failedIOException
- creating the input stream failed
-
getInputStream
InputStream getInputStream(InputStream is, char[] password) throws GeneralSecurityException, IOException
Creates an decrypting input stream using a given password.- Parameters:
is
- the input stream to be wrappedpassword
- the password to be used- Returns:
- an decrypting input stream
- Throws:
GeneralSecurityException
- creating the input stream failedIOException
- creating the input stream failed
-
getSmartInputStream
InputStream getSmartInputStream(InputStream is) throws GeneralSecurityException, IOException
Creates a smart decrypting input stream using the default password. The implementation looks at the binary content to decide if it was encrypted or not thereby providing transparent access to encrypted/unencrypted files.- Parameters:
is
- the input stream to be wrapped- Returns:
- an decrypting input stream
- Throws:
GeneralSecurityException
- creating the input stream failedIOException
- creating the input stream failed
-
getSmartInputStream
InputStream getSmartInputStream(InputStream is, char[] password) throws GeneralSecurityException, IOException
Creates a smart decrypting input stream using a given password. The implementation looks at the binary content to decide if it was encrypted or not thereby providing transparent access to encrypted/unencrypted files.- Parameters:
is
- the input stream to be wrappedpassword
- the password to be used- Returns:
- an decrypting input stream
- Throws:
GeneralSecurityException
- creating the input stream failedIOException
- creating the input stream failed
-
getOutputStream
OutputStream getOutputStream(OutputStream os) throws GeneralSecurityException, IOException
Creates an encrypting output stream using the default password.- Parameters:
os
- the output stream to be wrapped- Returns:
- an encrypting output stream
- Throws:
GeneralSecurityException
- creating the output stream failedIOException
- creating the output stream failed
-
getOutputStream
OutputStream getOutputStream(OutputStream os, char[] password) throws GeneralSecurityException, IOException
Creates an encrypting output stream using the given password.- Parameters:
os
- the output stream to be wrappedpassword
- the password to be used- Returns:
- an encrypting output stream
- Throws:
GeneralSecurityException
- creating the output stream failedIOException
- creating the output stream failed
-
getAlgorithm
String getAlgorithm()
Info about used algorithm.- Returns:
- algorithm string
-
-