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.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)
-
-
-
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 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
-
-