public class ApkSignatureSchemeV2Verifier extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ApkSignatureSchemeV2Verifier.SignatureNotFoundException |
Modifier and Type | Field and Description |
---|---|
static int |
SF_ATTRIBUTE_ANDROID_APK_SIGNED_ID |
static String |
SF_ATTRIBUTE_ANDROID_APK_SIGNED_NAME
.SF file header section attribute indicating that the APK is signed not just with
JAR signature scheme but also with APK Signature Scheme v2 or newer. |
Constructor and Description |
---|
ApkSignatureSchemeV2Verifier() |
Modifier and Type | Method and Description |
---|---|
static boolean |
hasSignature(String apkFile)
Returns
true if the provided APK contains an APK Signature Scheme V2 signature. |
static X509Certificate[][] |
verify(String apkFile)
Verifies APK Signature Scheme v2 signatures of the provided APK and returns the certificates
associated with each signer.
|
public static final String SF_ATTRIBUTE_ANDROID_APK_SIGNED_NAME
.SF
file header section attribute indicating that the APK is signed not just with
JAR signature scheme but also with APK Signature Scheme v2 or newer. This attribute
facilitates v2 signature stripping detection.
The attribute contains a comma-separated set of signature scheme IDs.
public static final int SF_ATTRIBUTE_ANDROID_APK_SIGNED_ID
public static boolean hasSignature(String apkFile) throws IOException
true
if the provided APK contains an APK Signature Scheme V2 signature.
NOTE: This method does not verify the signature.
IOException
public static X509Certificate[][] verify(String apkFile) throws ApkSignatureSchemeV2Verifier.SignatureNotFoundException, SecurityException, IOException
ApkSignatureSchemeV2Verifier.SignatureNotFoundException
- if the APK is not signed using APK Signature Scheme v2.SecurityException
- if a APK Signature Scheme v2 signature of this APK does not verify.IOException
- if an I/O error occurs while reading the APK file.