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:
java.io.Closeable, java.lang.Readable

public class EncryptedReader
extends java.io.BufferedReader


Field Summary
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
EncryptedReader(java.io.InputStream stream)
           
EncryptedReader(java.io.Reader stream)
           
 
Method Summary
static byte[] decrypt(java.lang.String cipher, java.lang.String pwd, byte[] data)
           
 java.lang.String getAlgorithm()
           
 java.io.InputStream getInputStream()
           
static boolean isEncrypted(java.io.File f)
           
 void prefetch()
           
 java.lang.String readLine()
           
 void setAlgorithm(java.lang.String cipherAlgorithm)
           
 void setKey(SecurityCrypto key)
           
 void useKey(java.lang.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(java.io.InputStream stream)

EncryptedReader

public EncryptedReader(java.io.Reader stream)
Method Detail

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.lang.Exception
Throws:
java.lang.Exception

prefetch

public void prefetch()
              throws java.lang.Exception
Throws:
java.lang.Exception

useKey

public void useKey(java.lang.String keyPath)
            throws java.lang.Exception
Throws:
java.lang.Exception

setKey

public void setKey(SecurityCrypto key)

setAlgorithm

public void setAlgorithm(java.lang.String cipherAlgorithm)

getAlgorithm

public java.lang.String getAlgorithm()

readLine

public java.lang.String readLine()
                          throws java.io.IOException
Overrides:
readLine in class java.io.BufferedReader
Throws:
java.io.IOException

isEncrypted

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

decrypt

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