Class GSSInputStream

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

    public class GSSInputStream
    extends java.io.InputStream
    • Constructor Summary

      Constructors 
      Constructor Description
      GSSInputStream​(java.io.InputStream wrapped, org.ietf.jgss.GSSContext gssContext, org.ietf.jgss.MessageProp messageProp)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int read()  
      int read​(byte[] buffer, int pos, int len)  
      private int readEncryptedBytesAndUnwrap()
      Reads the encrypted message, and unwraps it.
      private int readLength()
      Reads the length of the wrapper message.
      • Methods inherited from class java.io.InputStream

        available, close, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
      • Methods inherited from class java.lang.Object

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

      • gssContext

        private final org.ietf.jgss.GSSContext gssContext
      • messageProp

        private final org.ietf.jgss.MessageProp messageProp
      • wrapped

        private final java.io.InputStream wrapped
      • encrypted

        private byte[] encrypted
      • encryptedPos

        private int encryptedPos
      • encryptedLength

        private int encryptedLength
      • unencrypted

        private byte[] unencrypted
      • unencryptedPos

        private int unencryptedPos
      • int4Buf

        private final byte[] int4Buf
      • lenPos

        private int lenPos
      • int1Buf

        private final byte[] int1Buf
    • Constructor Detail

      • GSSInputStream

        public GSSInputStream​(java.io.InputStream wrapped,
                              org.ietf.jgss.GSSContext gssContext,
                              org.ietf.jgss.MessageProp messageProp)
    • Method Detail

      • read

        public int read()
                 throws java.io.IOException
        Specified by:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • read

        public int read​(byte[] buffer,
                        int pos,
                        int len)
                 throws java.io.IOException
        Overrides:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • readLength

        private int readLength()
                        throws java.io.IOException
        Reads the length of the wrapper message.
        Returns:
        -1 of end of stream reached, 0 if length is not fully read yet, and 1 if length is fully read
        Throws:
        java.io.IOException - if read fails
      • readEncryptedBytesAndUnwrap

        private int readEncryptedBytesAndUnwrap()
                                         throws java.io.IOException
        Reads the encrypted message, and unwraps it.
        Returns:
        -1 of end of stream reached, 0 if the message is not fully read yet, and 1 if length is fully read
        Throws:
        java.io.IOException - if read fails