Package org.postgresql.gss
Class GSSInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.postgresql.gss.GSSInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class GSSInputStream extends java.io.InputStream
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]encryptedprivate intencryptedLengthprivate intencryptedPosprivate org.ietf.jgss.GSSContextgssContextprivate byte[]int1Bufprivate byte[]int4Bufprivate intlenPosprivate org.ietf.jgss.MessagePropmessagePropprivate byte[]unencryptedprivate intunencryptedPosprivate java.io.InputStreamwrapped
-
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 intread()intread(byte[] buffer, int pos, int len)private intreadEncryptedBytesAndUnwrap()Reads the encrypted message, and unwraps it.private intreadLength()Reads the length of the wrapper message.
-
-
-
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
-
-
Method Detail
-
read
public int read() throws java.io.IOException- Specified by:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read(byte[] buffer, int pos, int len) throws java.io.IOException- Overrides:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
readLength
private int readLength() throws java.io.IOExceptionReads 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.IOExceptionReads 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
-
-