Class EncryptedReader

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, java.lang.Readable

    public class EncryptedReader
    extends java.io.BufferedReader
    • Field Summary

      • Fields inherited from class java.io.Reader

        lock
    • 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)  
      • Methods inherited from class java.io.BufferedReader

        close, lines, mark, markSupported, read, read, ready, reset, skip
      • Methods inherited from class java.io.Reader

        nullReader, read, read, transferTo
      • 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
      • 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