public class KeySetManagerService extends Object
Modifier and Type | Field and Description |
---|---|
static int |
CURRENT_VERSION |
static int |
FIRST_VERSION |
static long |
KEYSET_NOT_FOUND
Sentinel value returned when a
KeySet is not found. |
protected LongSparseArray<ArraySet<Long>> |
mKeySetMapping |
protected static long |
PUBLIC_KEY_NOT_FOUND
Sentinel value returned when public key is not found.
|
Constructor and Description |
---|
KeySetManagerService(ArrayMap<String,com.android.server.pm.PackageSetting> packages) |
Modifier and Type | Method and Description |
---|---|
void |
addScannedPackageLPw(PackageParser.Package pkg) |
void |
assertScannedPackageValid(PackageParser.Package pkg)
addScannedPackageLPw directly modifies the package metadata in pm.Settings
at a point of no-return.
|
void |
dumpLPr(PrintWriter pw,
String packageName,
com.android.server.pm.PackageManagerService.DumpState dumpState) |
String |
encodePublicKey(PublicKey k) |
com.android.server.pm.KeySetHandle |
getKeySetByAliasAndPackageNameLPr(String packageName,
String alias)
Fetched the
KeySetHandle that a given package refers to by the
provided alias. |
ArraySet<PublicKey> |
getPublicKeysFromKeySetLPr(long id)
Fetches the
public keys which belong to the specified
KeySet id. |
com.android.server.pm.KeySetHandle |
getSigningKeySetByPackageNameLPr(String packageName)
Fetches the proper
KeySet that signed the given
package. |
boolean |
isIdValidKeySetId(long id) |
boolean |
packageIsSignedByExactlyLPr(String packageName,
com.android.server.pm.KeySetHandle ks)
Determine if a package is signed by the given KeySet.
|
boolean |
packageIsSignedByLPr(String packageName,
com.android.server.pm.KeySetHandle ks)
Determine if a package is signed by the given KeySet.
|
void |
removeAppKeySetDataLPw(String packageName) |
public static final int FIRST_VERSION
public static final int CURRENT_VERSION
public static final long KEYSET_NOT_FOUND
KeySet
is not found.protected static final long PUBLIC_KEY_NOT_FOUND
protected final LongSparseArray<ArraySet<Long>> mKeySetMapping
public boolean packageIsSignedByLPr(String packageName, com.android.server.pm.KeySetHandle ks)
public boolean packageIsSignedByExactlyLPr(String packageName, com.android.server.pm.KeySetHandle ks)
public void assertScannedPackageValid(PackageParser.Package pkg) throws PackageManagerException
PackageManagerException
public void addScannedPackageLPw(PackageParser.Package pkg)
public com.android.server.pm.KeySetHandle getKeySetByAliasAndPackageNameLPr(String packageName, String alias)
KeySetHandle
that a given package refers to by the
provided alias. Returns null if the package is unknown or does not have a
KeySet corresponding to that alias.public boolean isIdValidKeySetId(long id)
public ArraySet<PublicKey> getPublicKeysFromKeySetLPr(long id)
public keys
which belong to the specified
KeySet id.
Returns null
if the identifier doesn't
identify a KeySetHandle
.public com.android.server.pm.KeySetHandle getSigningKeySetByPackageNameLPr(String packageName)
KeySet
that signed the given
package.IllegalArgumentException
- if the package has no keyset data.NullPointerException
- if the packgae is unknown.public void removeAppKeySetDataLPw(String packageName)
public String encodePublicKey(PublicKey k) throws IOException
IOException
public void dumpLPr(PrintWriter pw, String packageName, com.android.server.pm.PackageManagerService.DumpState dumpState)