Home
last modified time | relevance | path

Searched refs:alias (Results 1 – 25 of 126) sorted by relevance

123456

/frameworks/base/keystore/java/android/security/
DIKeyChainService.aidl31 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 …]
DCredentials.java180 public static boolean deleteAllTypesForAlias(KeyStore keystore, String alias) { in deleteAllTypesForAlias() argument
181 return deleteAllTypesForAlias(keystore, alias, KeyStore.UID_SELF); in deleteAllTypesForAlias()
189 public static boolean deleteAllTypesForAlias(KeyStore keystore, String alias, int uid) { in deleteAllTypesForAlias() argument
194 return deleteUserKeyTypeForAlias(keystore, alias, uid) in deleteAllTypesForAlias()
195 & deleteCertificateTypesForAlias(keystore, alias, uid); in deleteAllTypesForAlias()
203 public static boolean deleteCertificateTypesForAlias(KeyStore keystore, String alias) { in deleteCertificateTypesForAlias() argument
204 return deleteCertificateTypesForAlias(keystore, alias, KeyStore.UID_SELF); in deleteCertificateTypesForAlias()
212 public static boolean deleteCertificateTypesForAlias(KeyStore keystore, String alias, int uid) { in deleteCertificateTypesForAlias() argument
217 return keystore.delete(Credentials.USER_CERTIFICATE + alias, uid) in deleteCertificateTypesForAlias()
218 & keystore.delete(Credentials.CA_CERTIFICATE + alias, uid); in deleteCertificateTypesForAlias()
[all …]
DKeyChain.java425 @Nullable String host, int port, @Nullable String alias) { in choosePrivateKeyAlias() argument
432 choosePrivateKeyAlias(activity, response, keyTypes, issuers, uri, alias); in choosePrivateKeyAlias()
480 @Nullable Uri uri, @Nullable String alias) { in choosePrivateKeyAlias() argument
508 intent.putExtra(EXTRA_ALIAS, alias); in choosePrivateKeyAlias()
539 @Override public void alias(String alias) { in alias() method in KeyChain.AliasResponse
540 keyChainAliasResponse.alias(alias); in alias()
569 public static PrivateKey getPrivateKey(@NonNull Context context, @NonNull String alias) in getPrivateKey() argument
571 KeyPair keyPair = getKeyPair(context, alias); in getPrivateKey()
581 public static KeyPair getKeyPair(@NonNull Context context, @NonNull String alias) in getKeyPair() argument
583 if (alias == null) { in getKeyPair()
[all …]
DKeyStore.java551 private int generateKeyInternal(String alias, KeymasterArguments args, byte[] entropy, int uid, in generateKeyInternal() argument
559 error = mBinder.generateKey(promise, alias, args, entropy, uid, flags); in generateKeyInternal()
583 public int generateKey(String alias, KeymasterArguments args, byte[] entropy, int uid, in generateKey() argument
588 int error = generateKeyInternal(alias, args, entropy, uid, flags, outCharacteristics); in generateKey()
590 mBinder.del(alias, uid); in generateKey()
591 error = generateKeyInternal(alias, args, entropy, uid, flags, outCharacteristics); in generateKey()
603 public int generateKey(String alias, KeymasterArguments args, byte[] entropy, int flags, in generateKey() argument
605 return generateKey(alias, args, entropy, UID_SELF, flags, outCharacteristics); in generateKey()
608 public int getKeyCharacteristics(String alias, KeymasterBlob clientId, KeymasterBlob appId, in getKeyCharacteristics() argument
616 int error = mBinder.getKeyCharacteristics(promise, alias, clientId, appId, uid); in getKeyCharacteristics()
[all …]
/frameworks/base/keystore/java/android/security/keystore/
DAndroidKeyStoreSpi.java95 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 …]
DAndroidKeyStoreRSAPublicKey.java31 …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()
DAndroidKeyStoreECPublicKey.java33 …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/services/robotests/src/com/android/server/testing/shadows/
DShadowRecoveryController.java77 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/services/backup/java/com/android/server/backup/encryption/keys/
DRecoverableKeyStoreSecondaryKeyManager.java72 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/
DTestOnlyInsecureCertificateHelperTest.java82 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 …]
DWrappedKeyTest.java119 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/
DApplicationKeyStorage.java70 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/
DKeyStoreProxyImpl.java44 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()
DRecoverableKeyStoreManager.java394 public void setRecoveryStatus(@NonNull String alias, int status) throws RemoteException { in setRecoveryStatus() argument
396 Preconditions.checkNotNull(alias, "alias is null"); in setRecoveryStatus()
397 long updatedRows = mDatabase.setRecoveryStatus(Binder.getCallingUid(), alias, status); in setRecoveryStatus()
643 for (String alias : keysByAlias.keySet()) { in importKeyMaterials()
644 mApplicationKeyStorage.setSymmetricKeyEntry(userId, uid, alias, keysByAlias.get(alias)); in importKeyMaterials()
645 String grantAlias = getAlias(userId, uid, alias); in importKeyMaterials()
646 Log.i(TAG, String.format(Locale.US, "Import %s -> %s", alias, grantAlias)); in importKeyMaterials()
647 grantAliasesByAlias.put(alias, grantAlias); in importKeyMaterials()
660 private @Nullable String getAlias(int userId, int uid, String alias) { in getAlias() argument
661 return mApplicationKeyStorage.getGrantAlias(userId, uid, alias); in getAlias()
[all …]
DRecoverableKeyGenerator.java98 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()
DKeyStoreProxy.java34 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
DWrappedKey.java209 for (String alias : wrappedKeys.keySet()) { in unwrapKeys()
210 WrappedKey wrappedKey = wrappedKeys.get(alias); in unwrapKeys()
216 alias, in unwrapKeys()
234 alias), in unwrapKeys()
238 unwrappedKeys.put(alias, Pair.create(key, wrappedKey.getKeyMetadata())); in unwrapKeys()
DTestOnlyInsecureCertificateHelper.java123 String alias = entry.getKey(); in keepOnlyWhitelistedInsecureKeys() local
124 if (alias != null in keepOnlyWhitelistedInsecureKeys()
125 && alias.startsWith(TrustedRootCertificates.INSECURE_KEY_ALIAS_PREFIX)) { in keepOnlyWhitelistedInsecureKeys()
128 Log.d(TAG, "adding key with insecure alias " + alias + " to the recovery snapshot"); in keepOnlyWhitelistedInsecureKeys()
/frameworks/base/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/storage/
DRecoverableKeyStoreDbTest.java83 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/
DPackageKeySetData.java53 protected void addUpgradeKeySet(String alias) { in addUpgradeKeySet() argument
54 if (alias == null) { in addUpgradeKeySet()
59 Long ks = mKeySetAliases.get(alias); in addUpgradeKeySet()
63 throw new IllegalArgumentException("Upgrade keyset alias " + alias in addUpgradeKeySet()
105 protected void addDefinedKeySet(long ks, String alias) { in addDefinedKeySet() argument
106 mKeySetAliases.put(alias, ks); in addDefinedKeySet()
/frameworks/base/core/java/android/security/keystore/recovery/
DRecoveryController.java448 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 …]
DWrappedApplicationKey.java75 public @NonNull Builder setAlias(@NonNull String alias) { in setAlias() argument
76 mInstance.mAlias = alias; in setAlias()
122 public WrappedApplicationKey(@NonNull String alias, @NonNull byte[] encryptedKeyMaterial) { in WrappedApplicationKey() argument
123 mAlias = Preconditions.checkNotNull(alias); in WrappedApplicationKey()
/frameworks/ex/common/java/com/android/common/content/
DProjectionMap.java37 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/
DILockSettings.aidl73 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
/frameworks/base/core/java/android/security/net/config/
DTrustedCertificateStoreAdapter.java78 public Certificate getCertificate(String alias) { in getCertificate() argument
83 public Certificate getCertificate(String alias, boolean includeDeletedSystem) { in getCertificate() argument
88 public Date getCreationDate(String alias) { in getCreationDate() argument
108 public boolean containsAlias(String alias) { in containsAlias() argument

123456