Package com.ibm.di.security
Class EncryptedReader
- java.lang.Object
-
- java.io.Reader
-
- java.io.BufferedReader
-
- com.ibm.di.security.EncryptedReader
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.lang.Readable
public class EncryptedReader extends java.io.BufferedReader
-
-
Constructor Summary
Constructors Constructor Description EncryptedReader(java.io.InputStream stream)EncryptedReader(java.io.Reader stream)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static byte[]decrypt(java.lang.String cipher, java.lang.String pwd, byte[] data)java.lang.StringgetAlgorithm()java.io.InputStreamgetInputStream()static booleanisEncrypted(java.io.File f)voidprefetch()java.lang.StringreadLine()voidsetAlgorithm(java.lang.String cipherAlgorithm)voidsetKey(SecurityCrypto key)voiduseKey(java.lang.String keyPath)
-
-
-
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:
readLinein classjava.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
-
-