Class SignedApplicationBinaryInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
SignedApplicationVerifier.verify(InputStream).
Reading this stream returns the Application binary payload only (the install-request wrapper has already been stripped). The digital signature is verified lazily: it is checked once this stream has been entirely consumed. Until then the integrity of the content is not guaranteed, so callers must not trust partial reads.
Warning: the signature is only verified after the stream has been fully consumed. Installing this
stream directly (for example with a Kernel install API) may result in writing an Application, possibly to persistent
memory, before it has been verified. Once the stream has been fully read, call isVerified() to confirm the
signature before trusting the installed Application.
- Since:
- 1.0.0
-
Method Summary
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skipNBytes, transferTo
-
Method Details
-
isVerified
Tells whether the digital signature of this Application has been verified.This method provides an explicit verification checkpoint: it can only be called once this stream has been fully consumed (which triggers the lazy signature verification).
- Returns:
trueif the signature has been successfully verified.- Throws:
IllegalStateException- if this stream has not been fully consumed yet.InvalidSignatureException- if the signature verification failed.
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
skip
- Overrides:
skipin classInputStream- Throws:
IOException
-
available
- Overrides:
availablein classInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-