public final class StrictJarFile extends Object
Modifier and Type | Class and Description |
---|---|
static class |
StrictJarFile.RAFStream
Wrap a stream around a RandomAccessFile.
|
static class |
StrictJarFile.ZipInflaterInputStream |
Constructor and Description |
---|
StrictJarFile(String fileName) |
StrictJarFile(String fileName,
boolean verify,
boolean signatureSchemeRollbackProtectionsEnforced) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
ZipEntry |
findEntry(String name) |
Certificate[][] |
getCertificateChains(ZipEntry ze)
Return all certificate chains for a given
ZipEntry belonging to this jar. |
Certificate[] |
getCertificates(ZipEntry ze)
Deprecated.
Switch callers to use getCertificateChains instead
|
InputStream |
getInputStream(ZipEntry ze) |
StrictJarManifest |
getManifest() |
Iterator<ZipEntry> |
iterator() |
public StrictJarFile(String fileName) throws IOException, SecurityException
IOException
SecurityException
public StrictJarFile(String fileName, boolean verify, boolean signatureSchemeRollbackProtectionsEnforced) throws IOException, SecurityException
verify
- whether to verify the file's JAR signatures and collect the corresponding
signer certificates.signatureSchemeRollbackProtectionsEnforced
- true
to enforce protections against
stripping newer signature schemes (e.g., APK Signature Scheme v2) from the file, or
false
to ignore any such protections. This parameter is ignored when
verify
is false
.IOException
SecurityException
public StrictJarManifest getManifest()
public Iterator<ZipEntry> iterator() throws IOException
IOException
public Certificate[][] getCertificateChains(ZipEntry ze)
ZipEntry
belonging to this jar.
This method MUST be called only after fully exhausting the InputStream belonging
to this entry.
Returns null
if this jar file isn't signed or if this method is
called before the stream is processed.@Deprecated public Certificate[] getCertificates(ZipEntry ze)
ZipEntry
belonging to this jar.
This method MUST be called only after fully exhausting the InputStream belonging
to this entry.
Returns null
if this jar file isn't signed or if this method is
called before the stream is processed.public InputStream getInputStream(ZipEntry ze)
public void close() throws IOException
IOException