com.ibm.di.security
Class EncryptedReader

java.lang.Object
  extended by java.io.Reader
      extended by java.io.BufferedReader
          extended by com.ibm.di.security.EncryptedReader
All Implemented Interfaces:
Closeable, Readable

public class EncryptedReader
extends BufferedReader


Field Summary
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
EncryptedReader(InputStream stream)
           
EncryptedReader(Reader stream)
           
 
Method Summary
static byte[] decrypt(String cipher, String pwd, byte[] data)
           
 String getAlgorithm()
           
 InputStream getInputStream()
           
static boolean isEncrypted(File f)
           
 void prefetch()
           
 String readLine()
           
 void setAlgorithm(String cipherAlgorithm)
           
 void setKey(SecurityCrypto key)
           
 void useKey(String keyPath)
           
 
Methods inherited from class java.io.BufferedReader
close, mark, markSupported, read, read, ready, reset, skip
 
Methods inherited from class java.io.Reader
read, read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EncryptedReader

public EncryptedReader(InputStream stream)

EncryptedReader

public EncryptedReader(Reader stream)
Method Detail

getInputStream

public InputStream getInputStream()
                           throws Exception
Throws:
Exception

prefetch

public void prefetch()
              throws Exception
Throws:
Exception

useKey

public void useKey(String keyPath)
            throws Exception
Throws:
Exception

setKey

public void setKey(SecurityCrypto key)

setAlgorithm

public void setAlgorithm(String cipherAlgorithm)

getAlgorithm

public String getAlgorithm()

readLine

public String readLine()
                throws IOException
Overrides:
readLine in class BufferedReader
Throws:
IOException

isEncrypted

public static boolean isEncrypted(File f)
                           throws IOException
Throws:
IOException

decrypt

public static byte[] decrypt(String cipher,
                             String pwd,
                             byte[] data)
                      throws Exception
Throws:
Exception