/frameworks/base/keystore/java/android/security/ |
D | IKeyChainService.aidl | 31 String requestPrivateKey(String alias); in requestPrivateKey() argument 32 byte[] getCertificate(String alias); in getCertificate() argument 33 byte[] getCaCertificates(String alias); in getCaCertificates() argument 34 boolean isUserSelectable(String alias); in isUserSelectable() argument 35 void setUserSelectable(String alias, boolean isUserSelectable); in setUserSelectable() argument 38 int attestKey(in String alias, in byte[] challenge, in int[] idAttestationFlags, in attestKey() argument 40 boolean setKeyPairCertificate(String alias, in byte[] userCert, in byte[] certChain); in setKeyPairCertificate() argument 47 in byte[] privateKey, in byte[] userCert, in byte[] certChain, String alias, int uid); in installKeyPair() argument 48 boolean removeKeyPair(String alias); in removeKeyPair() argument 51 boolean deleteCaCertificate(String alias); in deleteCaCertificate() argument [all …]
|
D | Credentials.java | 186 public static boolean deleteAllTypesForAlias(KeyStore keystore, String alias) { in deleteAllTypesForAlias() argument 187 return deleteAllTypesForAlias(keystore, alias, KeyStore.UID_SELF); in deleteAllTypesForAlias() 195 public static boolean deleteAllTypesForAlias(KeyStore keystore, String alias, int uid) { in deleteAllTypesForAlias() argument 200 return deleteUserKeyTypeForAlias(keystore, alias, uid) in deleteAllTypesForAlias() 201 & deleteCertificateTypesForAlias(keystore, alias, uid); in deleteAllTypesForAlias() 209 public static boolean deleteCertificateTypesForAlias(KeyStore keystore, String alias) { in deleteCertificateTypesForAlias() argument 210 return deleteCertificateTypesForAlias(keystore, alias, KeyStore.UID_SELF); in deleteCertificateTypesForAlias() 218 public static boolean deleteCertificateTypesForAlias(KeyStore keystore, String alias, int uid) { in deleteCertificateTypesForAlias() argument 223 return keystore.delete(Credentials.USER_CERTIFICATE + alias, uid) in deleteCertificateTypesForAlias() 224 & keystore.delete(Credentials.CA_CERTIFICATE + alias, uid); in deleteCertificateTypesForAlias() [all …]
|
D | KeyChain.java | 433 @Nullable String host, int port, @Nullable String alias) { in choosePrivateKeyAlias() argument 440 choosePrivateKeyAlias(activity, response, keyTypes, issuers, uri, alias); in choosePrivateKeyAlias() 488 @Nullable Uri uri, @Nullable String alias) { in choosePrivateKeyAlias() argument 516 intent.putExtra(EXTRA_ALIAS, alias); in choosePrivateKeyAlias() 547 @Override public void alias(String alias) { in alias() argument 548 keyChainAliasResponse.alias(alias); in alias() 577 public static PrivateKey getPrivateKey(@NonNull Context context, @NonNull String alias) in getPrivateKey() argument 579 KeyPair keyPair = getKeyPair(context, alias); in getPrivateKey() 589 public static KeyPair getKeyPair(@NonNull Context context, @NonNull String alias) in getKeyPair() argument 591 if (alias == null) { in getKeyPair() [all …]
|
/frameworks/base/keystore/java/android/security/keystore/ |
D | AndroidKeyStoreSpi.java | 95 public Key engineGetKey(String alias, char[] password) throws NoSuchAlgorithmException, in engineGetKey() argument 97 String userKeyAlias = Credentials.USER_PRIVATE_KEY + alias; in engineGetKey() 101 userKeyAlias = Credentials.USER_SECRET_KEY + alias; in engineGetKey() 115 public Certificate[] engineGetCertificateChain(String alias) { in engineGetCertificateChain() argument 116 if (alias == null) { in engineGetCertificateChain() 120 final X509Certificate leaf = (X509Certificate) engineGetCertificate(alias); in engineGetCertificateChain() 132 final byte[] caBytes = mKeyStore.get(Credentials.CA_CERTIFICATE + alias, in engineGetCertificateChain() 155 public Certificate engineGetCertificate(String alias) { in engineGetCertificate() argument 156 if (alias == null) { in engineGetCertificate() 160 byte[] encodedCert = mKeyStore.get(Credentials.USER_CERTIFICATE + alias, mUid); in engineGetCertificate() [all …]
|
D | AndroidKeyStoreRSAPublicKey.java | 31 …public AndroidKeyStoreRSAPublicKey(String alias, int uid, byte[] x509EncodedForm, BigInteger modul… in AndroidKeyStoreRSAPublicKey() argument 33 super(alias, uid, KeyProperties.KEY_ALGORITHM_RSA, x509EncodedForm); in AndroidKeyStoreRSAPublicKey() 38 public AndroidKeyStoreRSAPublicKey(String alias, int uid, RSAPublicKey info) { in AndroidKeyStoreRSAPublicKey() argument 39 this(alias, uid, info.getEncoded(), info.getModulus(), info.getPublicExponent()); in AndroidKeyStoreRSAPublicKey()
|
D | AndroidKeyStoreECPublicKey.java | 33 …public AndroidKeyStoreECPublicKey(String alias, int uid, byte[] x509EncodedForm, ECParameterSpec p… in AndroidKeyStoreECPublicKey() argument 35 super(alias, uid, KeyProperties.KEY_ALGORITHM_EC, x509EncodedForm); in AndroidKeyStoreECPublicKey() 40 public AndroidKeyStoreECPublicKey(String alias, int uid, ECPublicKey info) { in AndroidKeyStoreECPublicKey() argument 41 this(alias, uid, info.getEncoded(), info.getParams(), info.getW()); in AndroidKeyStoreECPublicKey()
|
/frameworks/base/packages/BackupEncryption/test/robolectric/src/com/android/server/testing/shadows/ |
D | ShadowRecoveryController.java | 77 public Key generateKey(String alias) in generateKey() argument 90 sKeysByAlias.put(alias, key); in generateKey() 91 sKeyStatusesByAlias.put(alias, RecoveryController.RECOVERY_STATUS_SYNC_IN_PROGRESS); in generateKey() 96 public Key getKey(String alias) in getKey() argument 98 return sKeysByAlias.get(alias); in getKey() 102 public void removeKey(String alias) throws InternalRecoveryServiceException { in removeKey() argument 103 sKeyStatusesByAlias.remove(alias); in removeKey() 104 sKeysByAlias.remove(alias); in removeKey() 108 public int getRecoveryStatus(String alias) throws InternalRecoveryServiceException { in getRecoveryStatus() argument 111 alias, RecoveryController.RECOVERY_STATUS_PERMANENT_FAILURE); in getRecoveryStatus() [all …]
|
/frameworks/base/core/java/android/content/pm/parsing/component/ |
D | ParsedActivity.java | 146 ParsedActivity alias = new ParsedActivity(); in makeAlias() local 147 alias.setPackageName(target.getPackageName()); in makeAlias() 148 alias.setTargetActivity(targetActivityName); in makeAlias() 149 alias.configChanges = target.configChanges; in makeAlias() 150 alias.flags = target.flags; in makeAlias() 151 alias.privateFlags = target.privateFlags; in makeAlias() 152 alias.icon = target.icon; in makeAlias() 153 alias.logo = target.logo; in makeAlias() 154 alias.banner = target.banner; in makeAlias() 155 alias.labelRes = target.labelRes; in makeAlias() [all …]
|
/frameworks/base/packages/BackupEncryption/src/com/android/server/backup/encryption/keys/ |
D | RecoverableKeyStoreSecondaryKeyManager.java | 72 String alias = generateId(); in generate() local 73 mRecoveryController.generateKey(alias); in generate() 74 SecretKey key = (SecretKey) mRecoveryController.getKey(alias); in generate() 79 alias)); in generate() 81 return new RecoverableKeyStoreSecondaryKey(alias, key); in generate() 90 public void remove(String alias) throws InternalRecoveryServiceException { in remove() argument 91 mRecoveryController.removeKey(alias); in remove() 98 public Optional<RecoverableKeyStoreSecondaryKey> get(String alias) in get() argument 100 SecretKey secretKey = (SecretKey) mRecoveryController.getKey(alias); in get() 102 .map(key -> new RecoverableKeyStoreSecondaryKey(alias, key)); in get()
|
/frameworks/base/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/ |
D | TestOnlyInsecureCertificateHelperTest.java | 82 String alias = "secureAlias"; in testKeepOnlyWhitelistedInsecureKeys_singleNonWhitelistedKey() local 83 rawKeys.put(alias, Pair.create(TestData.generateKey(), /*metadata=*/ null)); in testKeepOnlyWhitelistedInsecureKeys_singleNonWhitelistedKey() 96 String alias = TrustedRootCertificates.INSECURE_KEY_ALIAS_PREFIX; in testKeepOnlyWhitelistedInsecureKeys_singleWhitelistedKey() local 97 rawKeys.put(alias, Pair.create(TestData.generateKey(), /*metadata=*/ null)); in testKeepOnlyWhitelistedInsecureKeys_singleWhitelistedKey() 98 expectedResult.put(alias, rawKeys.get(alias)); in testKeepOnlyWhitelistedInsecureKeys_singleWhitelistedKey() 111 String alias = "SECURE_ALIAS" + TrustedRootCertificates.INSECURE_KEY_ALIAS_PREFIX; in testKeepOnlyWhitelistedInsecureKeys() local 112 rawKeys.put(alias, Pair.create(TestData.generateKey(), /*metadata=*/ null)); in testKeepOnlyWhitelistedInsecureKeys() 114 alias = TrustedRootCertificates.INSECURE_KEY_ALIAS_PREFIX + "1"; in testKeepOnlyWhitelistedInsecureKeys() 115 rawKeys.put(alias, Pair.create(TestData.generateKey(), /*metadata=*/ null)); in testKeepOnlyWhitelistedInsecureKeys() 116 expectedResult.put(alias, rawKeys.get(alias)); in testKeepOnlyWhitelistedInsecureKeys() [all …]
|
D | WrappedKeyTest.java | 119 String alias = "karlin"; in decryptWrappedKeys_decryptsWrappedKeys_nullMetadata() local 125 keysByAlias.put(alias, wrappedKey); in decryptWrappedKeys_decryptsWrappedKeys_nullMetadata() 131 assertTrue(unwrappedKeys.containsKey(alias)); in decryptWrappedKeys_decryptsWrappedKeys_nullMetadata() 132 assertArrayEquals(appKey.getEncoded(), unwrappedKeys.get(alias).first.getEncoded()); in decryptWrappedKeys_decryptsWrappedKeys_nullMetadata() 133 assertArrayEquals(null, unwrappedKeys.get(alias).second); in decryptWrappedKeys_decryptsWrappedKeys_nullMetadata() 138 String alias = "karlin"; in decryptWrappedKeys_decryptsWrappedKeys_nonNullMetadata() local 144 keysByAlias.put(alias, wrappedKey); in decryptWrappedKeys_decryptsWrappedKeys_nonNullMetadata() 150 assertTrue(unwrappedKeys.containsKey(alias)); in decryptWrappedKeys_decryptsWrappedKeys_nonNullMetadata() 151 assertArrayEquals(appKey.getEncoded(), unwrappedKeys.get(alias).first.getEncoded()); in decryptWrappedKeys_decryptsWrappedKeys_nonNullMetadata() 152 assertArrayEquals(NON_NULL_METADATA, unwrappedKeys.get(alias).second); in decryptWrappedKeys_decryptsWrappedKeys_nonNullMetadata() [all …]
|
/frameworks/base/services/core/java/com/android/server/locksettings/recoverablekeystore/storage/ |
D | ApplicationKeyStorage.java | 70 public @Nullable String getGrantAlias(int userId, int uid, String alias) { in getGrantAlias() argument 73 Log.i(TAG, String.format(Locale.US, "Get %d/%d/%s", userId, uid, alias)); in getGrantAlias() 74 String keystoreAlias = Credentials.USER_PRIVATE_KEY + getInternalAlias(userId, uid, alias); in getGrantAlias() 78 public void setSymmetricKeyEntry(int userId, int uid, String alias, byte[] secretKey) in setSymmetricKeyEntry() argument 81 userId, uid, alias, secretKey.length)); in setSymmetricKeyEntry() 84 getInternalAlias(userId, uid, alias), in setSymmetricKeyEntry() 97 public void deleteEntry(int userId, int uid, String alias) { in deleteEntry() argument 98 Log.i(TAG, String.format(Locale.US, "Del %d/%d/%s", userId, uid, alias)); in deleteEntry() 100 mKeyStore.deleteEntry(getInternalAlias(userId, uid, alias)); in deleteEntry() 117 private String getInternalAlias(int userId, int uid, String alias) { in getInternalAlias() argument [all …]
|
/frameworks/base/services/core/java/com/android/server/locksettings/recoverablekeystore/ |
D | KeyStoreProxyImpl.java | 44 public boolean containsAlias(String alias) throws KeyStoreException { in containsAlias() argument 45 return mKeyStore.containsAlias(alias); in containsAlias() 49 public Key getKey(String alias, char[] password) in getKey() argument 51 return mKeyStore.getKey(alias, password); in getKey() 55 public void setEntry(String alias, KeyStore.Entry entry, KeyStore.ProtectionParameter protParam) in setEntry() argument 57 mKeyStore.setEntry(alias, entry, protParam); in setEntry() 61 public void deleteEntry(String alias) throws KeyStoreException { in deleteEntry() argument 62 mKeyStore.deleteEntry(alias); in deleteEntry()
|
D | RecoverableKeyStoreManager.java | 395 public void setRecoveryStatus(@NonNull String alias, int status) throws RemoteException { in setRecoveryStatus() argument 397 Objects.requireNonNull(alias, "alias is null"); in setRecoveryStatus() 398 long updatedRows = mDatabase.setRecoveryStatus(Binder.getCallingUid(), alias, status); in setRecoveryStatus() 644 for (String alias : keysByAlias.keySet()) { in importKeyMaterials() 645 mApplicationKeyStorage.setSymmetricKeyEntry(userId, uid, alias, keysByAlias.get(alias)); in importKeyMaterials() 646 String grantAlias = getAlias(userId, uid, alias); in importKeyMaterials() 647 Log.i(TAG, String.format(Locale.US, "Import %s -> %s", alias, grantAlias)); in importKeyMaterials() 648 grantAliasesByAlias.put(alias, grantAlias); in importKeyMaterials() 661 private @Nullable String getAlias(int userId, int uid, String alias) { in getAlias() argument 662 return mApplicationKeyStorage.getGrantAlias(userId, uid, alias); in getAlias() [all …]
|
D | RecoverableKeyGenerator.java | 98 PlatformEncryptionKey platformKey, int userId, int uid, String alias, in generateAndStoreKey() argument 105 long result = mDatabase.insertKey(userId, uid, alias, wrappedKey); in generateAndStoreKey() 110 Locale.US, "Failed writing (%d, %s) to database.", uid, alias)); in generateAndStoreKey() 143 @NonNull PlatformEncryptionKey platformKey, int userId, int uid, @NonNull String alias, in importKey() argument 149 long result = mDatabase.insertKey(userId, uid, alias, wrappedKey); in importKey() 154 Locale.US, "Failed writing (%d, %s) to database.", uid, alias)); in importKey()
|
D | KeyStoreProxy.java | 34 boolean containsAlias(String alias) throws KeyStoreException; in containsAlias() argument 37 Key getKey(String alias, char[] password) in getKey() argument 41 void setEntry(String alias, KeyStore.Entry entry, KeyStore.ProtectionParameter protParam) in setEntry() argument 45 void deleteEntry(String alias) throws KeyStoreException; in deleteEntry() argument
|
/frameworks/base/packages/BackupEncryption/src/com/android/server/backup/encryption/tasks/ |
D | InitializeRecoverableSecondaryKeyTask.java | 109 String alias = key.getAlias(); in runInternal() local 110 Slog.i(TAG, "Generated new secondary key " + alias); in runInternal() 113 mBackupServer.setActiveSecondaryKeyAlias(alias, /*tertiaryKeys=*/ Collections.emptyMap()); in runInternal() 114 Slog.v(TAG, "Successfully synced %s " + alias + " with server."); in runInternal() 116 mCryptoSettings.initializeWithKeyAlias(alias); in runInternal() 117 Slog.v(TAG, "Successfully saved " + alias + " as active secondary to disk."); in runInternal() 145 String alias = maybeAlias.get(); in loadFromSetting() local 148 key = mSecondaryKeyManager.get(alias); in loadFromSetting() 152 "Initialized with key but it was not in key store: " + alias); in loadFromSetting()
|
D | StartSecondaryKeyRotationTask.java | 91 String alias = newSecondaryKey.getAlias(); in run() local 92 Slog.i(TAG, "Generated a new secondary key with alias '" + alias + "'."); in run() 94 mCryptoSettings.setNextSecondaryAlias(alias); in run() 95 Slog.i(TAG, "Successfully set '" + alias + "' as next key to rotate to"); in run() 99 mSecondaryKeyManager.remove(alias); in run()
|
/frameworks/base/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/storage/ |
D | RecoverableKeyStoreDbTest.java | 83 String alias = "test-alias"; in insertKey_replacesOldKey() local 90 mRecoverableKeyStoreDb.insertKey(userId, uid, alias, wrappedKey); in insertKey_replacesOldKey() 92 WrappedKey retrievedKey = mRecoverableKeyStoreDb.getKey(uid, alias); in insertKey_replacesOldKey() 103 mRecoverableKeyStoreDb.insertKey(userId, uid, alias, wrappedKey); in insertKey_replacesOldKey() 105 retrievedKey = mRecoverableKeyStoreDb.getKey(uid, alias); in insertKey_replacesOldKey() 115 String alias = "pcoulton"; in insertKey_allowsTwoUidsToHaveSameAlias() local 127 mRecoverableKeyStoreDb.insertKey(userId, /*uid=*/ 1, alias, key1); in insertKey_allowsTwoUidsToHaveSameAlias() 128 mRecoverableKeyStoreDb.insertKey(userId, /*uid=*/ 2, alias, key2); in insertKey_allowsTwoUidsToHaveSameAlias() 132 mRecoverableKeyStoreDb.getKey(1, alias).getNonce()); in insertKey_allowsTwoUidsToHaveSameAlias() 135 mRecoverableKeyStoreDb.getKey(2, alias).getNonce()); in insertKey_allowsTwoUidsToHaveSameAlias() [all …]
|
/frameworks/base/services/core/java/com/android/server/pm/ |
D | PackageKeySetData.java | 55 protected void addUpgradeKeySet(String alias) { in addUpgradeKeySet() argument 56 if (alias == null) { in addUpgradeKeySet() 61 Long ks = mKeySetAliases.get(alias); in addUpgradeKeySet() 65 throw new IllegalArgumentException("Upgrade keyset alias " + alias in addUpgradeKeySet() 104 protected void addDefinedKeySet(long ks, String alias) { in addDefinedKeySet() argument 105 mKeySetAliases.put(alias, ks); in addDefinedKeySet()
|
/frameworks/base/core/java/android/security/keystore/recovery/ |
D | RecoveryController.java | 448 public void setRecoveryStatus(@NonNull String alias, int status) in setRecoveryStatus() argument 451 mBinder.setRecoveryStatus(alias, status); in setRecoveryStatus() 473 public int getRecoveryStatus(@NonNull String alias) throws InternalRecoveryServiceException { in getRecoveryStatus() argument 476 Integer status = allStatuses.get(alias); in getRecoveryStatus() 543 public @NonNull Key generateKey(@NonNull String alias) throws InternalRecoveryServiceException, in generateKey() argument 546 String grantAlias = mBinder.generateKey(alias); in generateKey() 584 public @NonNull Key generateKey(@NonNull String alias, @Nullable byte[] metadata) in generateKey() argument 587 String grantAlias = mBinder.generateKeyWithMetadata(alias, metadata); in generateKey() 617 public @NonNull Key importKey(@NonNull String alias, @NonNull byte[] keyBytes) in importKey() argument 620 String grantAlias = mBinder.importKey(alias, keyBytes); in importKey() [all …]
|
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/ |
D | WifiKeyStore.java | 93 String existingAlias, String alias) { in installKeys() argument 97 if (!putUserPrivKeyAndCertsInKeyStore(alias, config.getClientPrivateKey(), in installKeys() 112 String caAlias = String.format("%s_%d", alias, i); in installKeys() 117 removeEntryFromKeyStore(alias); in installKeys() 127 if (!alias.equals(existingAlias)) { in installKeys() 137 config.setClientCertificateAlias(alias); in installKeys() 156 public boolean putCaCertInKeyStore(String alias, Certificate cert) { in putCaCertInKeyStore() argument 158 mKeyStore.setCertificateEntry(alias, cert); in putCaCertInKeyStore() 174 public boolean putUserPrivKeyAndCertsInKeyStore(String alias, Key key, Certificate[] certs) { in putUserPrivKeyAndCertsInKeyStore() argument 176 mKeyStore.setKeyEntry(alias, key, null, certs); in putUserPrivKeyAndCertsInKeyStore() [all …]
|
D | MacAddressUtil.java | 88 private Mac obtainMacRandHashFunctionInternal(int uid, String alias) { in obtainMacRandHashFunctionInternal() argument 92 Key key = keyStore.getKey(alias, null); in obtainMacRandHashFunctionInternal() 94 key = generateAndPersistNewMacRandomizationSecret(uid, alias); in obtainMacRandHashFunctionInternal() 97 Log.e(TAG, "Failed to generate secret for " + alias); in obtainMacRandHashFunctionInternal() 133 private SecretKey generateAndPersistNewMacRandomizationSecret(int uid, String alias) { in generateAndPersistNewMacRandomizationSecret() argument 138 new KeyGenParameterSpec.Builder(alias, in generateAndPersistNewMacRandomizationSecret()
|
/frameworks/ex/common/java/com/android/common/content/ |
D | ProjectionMap.java | 37 public Builder add(String alias, String expression) { in add() argument 38 mMap.putColumn(alias, expression + " AS " + alias); in add() 79 private void putColumn(String alias, String column) { in putColumn() argument 80 super.put(alias, column); in putColumn()
|
/frameworks/base/core/java/com/android/internal/widget/ |
D | ILockSettings.aidl | 73 String generateKey(String alias); in generateKey() argument 74 String generateKeyWithMetadata(String alias, in byte[] metadata); in generateKeyWithMetadata() argument 75 String importKey(String alias, in byte[] keyBytes); in importKey() argument 76 String importKeyWithMetadata(String alias, in byte[] keyBytes, in byte[] metadata); in importKeyWithMetadata() argument 77 String getKey(String alias); in getKey() argument 78 void removeKey(String alias); in removeKey() argument 81 void setRecoveryStatus(in String alias, int status); in setRecoveryStatus() argument
|