Home
last modified time | relevance | path

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

12

/cts/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/
DKeyManagementTest.java140 final String alias = "com.android.test.valid-rsa-key-1"; in testCanInstallAndRemoveValidRsaKeypair() local
143 assertThat(mDevicePolicyManager.installKeyPair(getWho(), mFakePrivKey, mFakeCert, alias)) in testCanInstallAndRemoveValidRsaKeypair()
147 assertGranted(alias, false); in testCanInstallAndRemoveValidRsaKeypair()
148 assertThat(new KeyChainAliasFuture(alias).get()).isEqualTo(alias); in testCanInstallAndRemoveValidRsaKeypair()
149 assertGranted(alias, true); in testCanInstallAndRemoveValidRsaKeypair()
152 assertThat(KeyChain.getPrivateKey(mActivity, alias).getAlgorithm()).isEqualTo("RSA"); in testCanInstallAndRemoveValidRsaKeypair()
155 assertThat(mDevicePolicyManager.removeKeyPair(getWho(), alias)).isTrue(); in testCanInstallAndRemoveValidRsaKeypair()
158 assertGranted(alias, false); in testCanInstallAndRemoveValidRsaKeypair()
207 final String alias = "com.android.test.clientkeychain"; in testCanInstallCertChain() local
210 assertThat(mDevicePolicyManager.installKeyPair(getWho(), privKey, certChain, alias, true)) in testCanInstallCertChain() local
[all …]
DDelegatedCertInstallerTest.java146 final String alias = keyStore.getCertificateAlias(caCert); in testCaCertsOperations() local
147 assertNotNull(alias); in testCaCertsOperations()
148 verifyOwnerInstalledStatus(alias, true); in testCaCertsOperations()
158 verifyOwnerInstalledStatus(alias, false); in testCaCertsOperations()
169 final String alias = "delegated-cert-installer-test-key"; in testInstallKeyPair() local
175 installKeyPair(TestCertificates.TEST_KEY, TestCertificates.TEST_CERT, alias); in testInstallKeyPair()
184 installKeyPair(TestCertificates.TEST_KEY, TestCertificates.TEST_CERT, alias); in testInstallKeyPair()
289 private void verifyOwnerInstalledStatus(String alias, boolean expectOwnerInstalled) { in verifyOwnerInstalledStatus() argument
293 assertEquals(expectOwnerInstalled, ownerInstalledCerts.contains(alias)); in verifyOwnerInstalledStatus()
312 private void installKeyPair(String key, String cert, String alias) { in installKeyPair() argument
[all …]
DSecurityLoggingTest.java585 private void verifyKeyGeneratedEventPresent(List<SecurityEvent> events, String alias) { in verifyKeyGeneratedEventPresent() argument
589 && getString(e, ALIAS_INDEX).contains(alias) in verifyKeyGeneratedEventPresent()
593 private void importKey(String alias) throws Exception{ in importKey() argument
596 ks.setEntry(alias, new KeyStore.SecretKeyEntry(new SecretKeySpec(new byte[32], "AES")), in importKey()
600 private void verifyKeyImportedEventPresent(List<SecurityEvent> events, String alias) { in verifyKeyImportedEventPresent() argument
604 && getString(e, ALIAS_INDEX).contains(alias) in verifyKeyImportedEventPresent()
614 private void verifyKeyDeletedEventPresent(List<SecurityEvent> events, String alias) { in verifyKeyDeletedEventPresent() argument
618 && getString(e, ALIAS_INDEX).contains(alias) in verifyKeyDeletedEventPresent()
/cts/hostsidetests/devicepolicy/app/CertInstaller/src/com/android/cts/certinstaller/
DCertSelectionDelegateTest.java72 String alias) { in onChoosePrivateKeyAlias() argument
103 final String alias = "com.android.test.valid-rsa-key-1"; in testCanSelectKeychainKeypairs() local
107 assertThat(mDpm.installKeyPair(null, privKey, cert, alias)).isTrue(); in testCanSelectKeychainKeypairs()
109 assertThat(new KeyChainAliasFuture(alias).get()).isEqualTo(alias); in testCanSelectKeychainKeypairs()
112 assertThat(KeyChain.getPrivateKey(mActivity, alias).getAlgorithm()).isEqualTo("RSA"); in testCanSelectKeychainKeypairs()
115 assertThat(mDpm.removeKeyPair(null, alias)).isTrue(); in testCanSelectKeychainKeypairs()
134 public void alias(final String chosenAlias) { in alias() method in CertSelectionDelegateTest.KeyChainAliasFuture
139 public KeyChainAliasFuture(String alias) in KeyChainAliasFuture() argument
145 + URLEncoder.encode(alias, "UTF-8")); in KeyChainAliasFuture()
DDirectDelegatedCertInstallerTest.java131 final String alias = "delegated-cert-installer-test-key"; in testInstallKeyPair() local
134 alias, true)).isTrue(); in testInstallKeyPair()
137 PrivateKey obtainedKey = KeyChain.getPrivateKey(getContext(), alias); in testInstallKeyPair()
142 assertThat(mDpm.removeKeyPair(null, alias)).isTrue(); in testInstallKeyPair()
143 assertThat(KeyChain.getPrivateKey(getContext(), alias)).isNull(); in testInstallKeyPair()
148 final String alias = "com.android.test.generated-rsa-1"; in testGenerateKeyPairWithoutDeviceIdAttestation() local
151 alias, in testGenerateKeyPairWithoutDeviceIdAttestation()
165 assertThat(mDpm.removeKeyPair(null, alias)).isTrue(); in testGenerateKeyPairWithoutDeviceIdAttestation()
DCertInstallerReceiver.java122 String alias = intent.getStringExtra(EXTRA_KEY_ALIAS); in onReceive() local
141 sendResult(context, dpm.installKeyPair(null, privatekey, certificate, alias), in onReceive()
/cts/tests/security/src/android/keystore/cts/
DKeyGenerationUtils.java33 private static KeyGenParameterSpec buildRsaKeySpecWithKeyAttestation(String alias) { in buildRsaKeySpecWithKeyAttestation() argument
35 alias, in buildRsaKeySpecWithKeyAttestation()
47 int deviceIdAttestationFlags, String alias) { in generateRsaKeyPair() argument
49 admin, "RSA", buildRsaKeySpecWithKeyAttestation(alias), in generateRsaKeyPair()
64 public static void generateRsaKey(DevicePolicyManager dpm, ComponentName admin, String alias) { in generateRsaKey() argument
65 assertThat(generateRsaKeyPair(dpm, admin, 0, alias)).isNotNull(); in generateRsaKey()
/cts/hostsidetests/devicepolicy/app/ProfileOwner/src/com/android/cts/profileowner/
DAdminActionBookkeepingTest.java72 final String alias = keyStore.getCertificateAlias(cert); in testGetPolicyInstalledCaCerts() local
73 assertNotNull(alias); in testGetPolicyInstalledCaCerts()
76 verifyOwnerInstalledStatus(alias, true); in testGetPolicyInstalledCaCerts()
82 verifyOwnerInstalledStatus(alias, false); in testGetPolicyInstalledCaCerts()
85 private void verifyOwnerInstalledStatus(String alias, boolean expectOwnerInstalled) { in verifyOwnerInstalledStatus() argument
89 assertEquals(expectOwnerInstalled, ownerInstalledCerts.contains(alias)); in verifyOwnerInstalledStatus()
/cts/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/
DKeyChainTestActivity.java194 public void alias(String alias) { in alias() argument
195 Log.i(TAG, "Got alias: " + alias); in alias()
196 if (alias == null) { in alias()
199 } else if (!alias.equals(ALIAS)) { in alias()
205 PrivateKey privateKey = KeyChain.getPrivateKey(KeyChainTestActivity.this, alias); in alias()
236 public void alias(String alias) { in alias() method in KeyChainTestActivity.SelectCertificateExpectingNone
237 Log.i(TAG, "Got alias: " + alias); in alias()
238 if (alias != null) { in alias()
/cts/tests/tests/keystore/src/android/keystore/cts/
DImportedKey.java32 public ImportedKey(String alias, KeyPair original, KeyPair keystoreBacked) { in ImportedKey() argument
33 mAlias = alias; in ImportedKey()
41 public ImportedKey(String alias, SecretKey original, SecretKey keystoreBacked) { in ImportedKey() argument
42 mAlias = alias; in ImportedKey()
DKeyStoreTest.java304 String alias = aliases.nextElement(); in clearKeyStore() local
305 ks.deleteEntry(alias); in clearKeyStore()
311 … public static void setPrivateKeyNoPassword(KeyStore ks, String alias, PrivateKeyEntry privateKey) in setPrivateKeyNoPassword() argument
313 ks.setKeyEntry(alias, privateKey.getPrivateKey(), null, privateKey.getCertificateChain()); in setPrivateKeyNoPassword()
318 public static void setPrivateKey(KeyStore ks, String alias) throws Exception { in setPrivateKey() argument
319 setPrivateKey(ks, alias, getPrivateKey()); in setPrivateKey()
322 String alias, in setPrivateKey() argument
325 ks.setKeyEntry(alias, in setPrivateKey()
334 public static void setPrivateKeyBytes(KeyStore ks, String alias) throws Exception { in setPrivateKeyBytes() argument
335 setPrivateKeyBytes(ks, alias, getPrivateKey()); in setPrivateKeyBytes()
[all …]
DAndroidKeyStoreTest.java732 String alias = aliases.nextElement(); in setUp() local
733 ksTemp.deleteEntry(alias); in setUp()
753 String alias = aliases.nextElement(); in tearDown() local
754 keyStore.deleteEntry(alias); in tearDown()
798 final String alias = aliases.nextElement(); in assertAliases() local
799 assertTrue("The alias should be in the expected set", expectedSet.contains(alias)); in assertAliases()
800 expectedSet.remove(alias); in assertAliases()
1889 String alias = "MyKey"; in testKeyStore_Encrypting_RSA_NONE_NOPADDING() local
1905 .setAlias(alias) in testKeyStore_Encrypting_RSA_NONE_NOPADDING()
1914 PrivateKey privateKey = (PrivateKey) ks.getKey(alias, null); in testKeyStore_Encrypting_RSA_NONE_NOPADDING()
[all …]
DTestUtils.java210 static void assertKeyStoreKeyPair(KeyStore keyStore, String alias, KeyPair keyPair) { in assertKeyStoreKeyPair() argument
219 entry = keyStore.getEntry(alias, null); in assertKeyStoreKeyPair()
220 cert = keyStore.getCertificate(alias); in assertKeyStoreKeyPair()
222 throw new RuntimeException("Failed to load entry: " + alias, e); in assertKeyStoreKeyPair()
480 String alias, in importIntoAndroidKeyStore() argument
486 keyStore.setEntry(alias, in importIntoAndroidKeyStore()
490 keyStore.getCertificate(alias).getPublicKey(), in importIntoAndroidKeyStore()
491 (PrivateKey) keyStore.getKey(alias, null)); in importIntoAndroidKeyStore()
495 String alias, in importIntoAndroidKeyStore() argument
500 keyStore.setEntry(alias, in importIntoAndroidKeyStore()
[all …]
DKeyAgreementTest.java156 private static KeyPair generateEphemeralAndroidKeyPair(String alias) in generateEphemeralAndroidKeyPair() argument
161 new KeyGenParameterSpec.Builder(alias, KeyProperties.PURPOSE_AGREE_KEY).build()); in generateEphemeralAndroidKeyPair()
DAttestKeyTest.java73 for (String alias : mAliasesToDelete) { in tearDown()
75 mKeyStore.deleteEntry(alias); in tearDown()
/cts/tests/tests/security/src/android/security/cts/
DCertificateTest.java157 for (String alias : aliases) { in getDeviceWfaCertificates()
158 assertTrue(wfaKeyStore.isCertificateEntry(alias)); in getDeviceWfaCertificates()
159 X509Certificate certificate = (X509Certificate) wfaKeyStore.getCertificate(alias); in getDeviceWfaCertificates()
178 for (String alias : aliases) { in getDeviceCertificates()
179 assertTrue(keyStore.isCertificateEntry(alias)); in getDeviceCertificates()
180 X509Certificate certificate = (X509Certificate) keyStore.getCertificate(alias); in getDeviceCertificates()
/cts/hostsidetests/devicepolicy/app/DeviceOwner/src/com/android/cts/deviceowner/
DAdminActionBookkeepingTest.java242 final String alias = keyStore.getCertificateAlias(cert); in testGetPolicyInstalledCaCerts() local
243 assertWithMessage("keystore.getCertificateAlias()").that(alias).isNotNull(); in testGetPolicyInstalledCaCerts()
246 verifyOwnerInstalledStatus(alias, true); in testGetPolicyInstalledCaCerts()
252 verifyOwnerInstalledStatus(alias, false); in testGetPolicyInstalledCaCerts()
255 private void verifyOwnerInstalledStatus(String alias, boolean expectOwnerInstalled) { in verifyOwnerInstalledStatus() argument
263 .contains(alias); in verifyOwnerInstalledStatus()
266 .doesNotContain(alias); in verifyOwnerInstalledStatus()
/cts/tests/tests/graphics/src/android/graphics/fonts/
DFontManagerTest.java129 for (FontConfig.Alias alias : aliases) { in fontManager_getFontConfig_checkAlias()
130 assertThat(alias.getName()).isNotEmpty(); in fontManager_getFontConfig_checkAlias()
131 assertThat(alias.getOriginal()).isNotEmpty(); in fontManager_getFontConfig_checkAlias()
132 assertThat(alias.getWeight()).isAtLeast(0); in fontManager_getFontConfig_checkAlias()
133 assertThat(alias.getWeight()).isAtMost(1000); in fontManager_getFontConfig_checkAlias()
136 assertThat(alias.getOriginal()).isIn(fallbackNames); in fontManager_getFontConfig_checkAlias()
/cts/hostsidetests/devicepolicy/app/DelegateApp/src/com/android/cts/delegate/
DCertInstallDelegateTest.java79 final String alias = "delegated-cert-installer-test-key"; in testCanAccessApis() local
88 mDpm.installKeyPair(null, privatekey, certificate, alias)); in testCanAccessApis()
91 assertTrue("Key pair not removed successfully", mDpm.removeKeyPair(null, alias)); in testCanAccessApis()
/cts/tests/tests/identity/src/android/security/identity/cts/
DUserAuthTest.java141 private boolean checkAuthBoundKey(String alias) { in checkAuthBoundKey() argument
147 KeyStore.Entry entry = ks.getEntry(alias, null); in checkAuthBoundKey()
162 void createAuthBoundKey(String alias, int timeoutSeconds) { in createAuthBoundKey() argument
168 alias, in createAuthBoundKey()
186 String alias = "authbound"; in testUserAuth() local
/cts/tests/tests/telephony/current/preconditions/src/android/telephony/cts/preconditions/
DTelephonyCleaner.java24 @OptionClass(alias="telephony-cleaner")
DTelephonyPreparer.java24 @OptionClass(alias="telephony-preparer")
/cts/apps/CtsVerifier/src/com/android/cts/verifier/security/
DKeyChainTest.java433 .alias(aliasCaptor.capture()); in chooseClientAlias()
448 public X509Certificate[] getCertificateChain(String alias) { in getCertificateChain() argument
452 KeyChain.getCertificateChain(KeyChainTest.this, alias); in getCertificateChain()
483 public PrivateKey getPrivateKey(String alias) { in getPrivateKey() argument
485 log("KeyChainKeyManager.getPrivateKey(\"" + alias + "\")"); in getPrivateKey()
486 PrivateKey privateKey = KeyChain.getPrivateKey(KeyChainTest.this, alias); in getPrivateKey()
DCredentialManagementAppActivity.java361 public void alias(String alias) { in alias() method in CredentialManagementAppActivity.TestKeyChainAliasCallback
362 mChosenAlias = alias; in alias()
/cts/common/device-side/bedstead/testapp/src/main/testapps/java/com/android/bedstead/testapp/
DBaseTestAppDeviceAdminReceiver.java111 String alias) { in onChoosePrivateKeyAlias() argument
112 return super.onChoosePrivateKeyAlias(context, intent, uid, uri, alias); in onChoosePrivateKeyAlias()

12