public class SignedInputStream
extends java.io.FilterInputStream
Modifier and Type | Field and Description |
---|---|
static int |
STREAM_TYPE_PK |
static int |
STREAM_TYPE_TLS |
static int |
STREAM_TYPE_UNSIGNED |
Constructor and Description |
---|
SignedInputStream(java.security.PublicKey sourceKey,
java.io.InputStream in,
java.net.Socket socket)
Create a stream that can verify the data read from the stream in
blocks.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isSecure() |
int |
read()
Read a byte from the stream.
|
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
boolean |
verifyBlock()
Reads a signature from the stream and verifies the bytes read since
the last verification based on that signature.
|
public static final int STREAM_TYPE_PK
public static final int STREAM_TYPE_UNSIGNED
public static final int STREAM_TYPE_TLS
public SignedInputStream(java.security.PublicKey sourceKey, java.io.InputStream in, java.net.Socket socket) throws java.lang.Exception
java.lang.Exception
public boolean isSecure()
public int read() throws java.io.IOException
read
in class java.io.FilterInputStream
java.io.IOException
public int read(byte[] b) throws java.io.IOException
read
in class java.io.FilterInputStream
java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.IOException
read
in class java.io.FilterInputStream
java.io.IOException
public boolean verifyBlock() throws java.io.IOException, java.security.SignatureException
java.io.IOException
java.security.SignatureException