org.apache.fulcrum.jce.crypto
Interface CryptoStreamFactory

All Known Implementing Classes:
CryptoStreamFactoryImpl

public interface CryptoStreamFactory

Interface for creating encrypting/decrypting streams.

Author:
Siegfried Goeschl

Method Summary
 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 wrapped
decryptionMode - the decryption mode (true|false|auto)
Returns:
an decrypting input stream
Throws:
GeneralSecurityException - creating the input stream failed
IOException - 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 wrapped
decryptionMode - the decryption mode (true|false|auto)
password - the password to be used
Returns:
an decrypting input stream
Throws:
GeneralSecurityException - creating the input stream failed
IOException - 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 failed
IOException - 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 wrapped
password - the password to be used
Returns:
an decrypting input stream
Throws:
GeneralSecurityException - creating the input stream failed
IOException - 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 failed
IOException - 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 wrapped
password - the password to be used
Returns:
an decrypting input stream
Throws:
GeneralSecurityException - creating the input stream failed
IOException - 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 decrypting input stream
Throws:
GeneralSecurityException - creating the ouptut stream failed
IOException - creating the ouptut 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 wrapped
password - the password to be used
Returns:
an decrypting input stream
Throws:
GeneralSecurityException - creating the ouptut stream failed
IOException - creating the ouptut stream failed


Copyright © 2008-2009 The Apache Software Foundation. All Rights Reserved.