Class OpenPgpInputStream

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

    public class OpenPgpInputStream
    extends java.io.BufferedInputStream
    InputStream used to determine the nature of potential OpenPGP data.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int MAX_BUFFER_SIZE  
      • Fields inherited from class java.io.BufferedInputStream

        buf, count, marklimit, markpos, pos
      • Fields inherited from class java.io.FilterInputStream

        in
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isAsciiArmored()  
      boolean isBinaryOpenPgp()
      Return true, if the data is possibly binary OpenPGP.
      boolean isLikelyOpenPgpMessage()
      Returns true, if the underlying data is very likely (more than 99,9%) an OpenPGP message.
      boolean isNonOpenPgp()  
      • Methods inherited from class java.io.BufferedInputStream

        available, close, mark, markSupported, read, read, reset, skip
      • Methods inherited from class java.io.FilterInputStream

        read
      • Methods inherited from class java.io.InputStream

        nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OpenPgpInputStream

        public OpenPgpInputStream​(java.io.InputStream in,
                                  boolean check)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • OpenPgpInputStream

        public OpenPgpInputStream​(java.io.InputStream in)
                           throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • isAsciiArmored

        public boolean isAsciiArmored()
      • isBinaryOpenPgp

        public boolean isBinaryOpenPgp()
        Return true, if the data is possibly binary OpenPGP. The criterion for this are less strict than for isLikelyOpenPgpMessage(), as it also accepts other OpenPGP packets at the beginning of the data stream. Use with caution.
        Returns:
        true if data appears to be binary OpenPGP data
      • isLikelyOpenPgpMessage

        public boolean isLikelyOpenPgpMessage()
        Returns true, if the underlying data is very likely (more than 99,9%) an OpenPGP message. OpenPGP Message means here that it starts with either an PGPEncryptedData, PGPCompressedData, PGPOnePassSignature or PGPLiteralData packet. The plausability of these data packets is checked as far as possible.
        Returns:
        true if likely OpenPGP message
      • isNonOpenPgp

        public boolean isNonOpenPgp()