| /cts/tests/tests/keystore/src/android/keystore/cts/ |
| D | MacTest.java | 212 for (String algorithm : EXPECTED_ALGORITHMS) { in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProvider() 214 SecretKey key = importDefaultKatKey(algorithm); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProvider() 217 Mac mac = Mac.getInstance(algorithm); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProvider() 221 throw new RuntimeException(algorithm + " failed", e); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProvider() 229 for (String algorithm : EXPECTED_ALGORITHMS) { in testMacGeneratedForEmptyMessage() 231 SecretKey key = importDefaultKatKey(algorithm); in testMacGeneratedForEmptyMessage() 234 Mac mac = Mac.getInstance(algorithm, provider); in testMacGeneratedForEmptyMessage() 242 throw new RuntimeException(algorithm + " failed", e); in testMacGeneratedForEmptyMessage() 250 for (String algorithm : EXPECTED_ALGORITHMS) { in testMacGeneratedByAndroidKeyStoreVerifiesByAndroidKeyStore() 252 SecretKey key = importDefaultKatKey(algorithm); in testMacGeneratedByAndroidKeyStoreVerifiesByAndroidKeyStore() [all …]
|
| D | KeyFactoryTest.java | 98 for (String algorithm : EXPECTED_ALGORITHMS) { in testGetKeySpecWithKeystorePrivateKeyAndKeyInfoReflectsAllAuthorizations() 110 KeyPairGenerator.getInstance(algorithm, EXPECTED_PROVIDER_NAME); in testGetKeySpecWithKeystorePrivateKeyAndKeyInfoReflectsAllAuthorizations() 120 KeyFactory keyFactory = getKeyFactory(algorithm); in testGetKeySpecWithKeystorePrivateKeyAndKeyInfoReflectsAllAuthorizations() 149 throw new RuntimeException("Failed for " + algorithm, e); in testGetKeySpecWithKeystorePrivateKeyAndKeyInfoReflectsAllAuthorizations() 156 for (String algorithm : EXPECTED_ALGORITHMS) { in testGetKeySpecWithKeystorePublicKeyRejectsKeyInfo() 159 KeyPairGenerator.getInstance(algorithm, EXPECTED_PROVIDER_NAME); in testGetKeySpecWithKeystorePublicKeyRejectsKeyInfo() 162 KeyFactory keyFactory = getKeyFactory(algorithm); in testGetKeySpecWithKeystorePublicKeyRejectsKeyInfo() 168 throw new RuntimeException("Failed for " + algorithm, e); in testGetKeySpecWithKeystorePublicKeyRejectsKeyInfo() 175 for (String algorithm : EXPECTED_ALGORITHMS) { in testGetKeySpecWithKeystorePrivateKeyRejectsTransparentKeySpecAndEncodedKeySpec() 178 if ("EC".equalsIgnoreCase(algorithm)) { in testGetKeySpecWithKeystorePrivateKeyRejectsTransparentKeySpecAndEncodedKeySpec() [all …]
|
| D | KeyGeneratorTest.java | 95 for (String algorithm : EXPECTED_ALGORITHMS) { in testGenerateWithoutInitThrowsIllegalStateException() 97 KeyGenerator keyGenerator = getKeyGenerator(algorithm); in testGenerateWithoutInitThrowsIllegalStateException() 103 throw new RuntimeException("Failed for " + algorithm, e); in testGenerateWithoutInitThrowsIllegalStateException() 109 for (String algorithm : EXPECTED_ALGORITHMS) { in testInitWithKeySizeThrowsUnsupportedOperationException() 111 KeyGenerator keyGenerator = getKeyGenerator(algorithm); in testInitWithKeySizeThrowsUnsupportedOperationException() 112 int keySizeBits = DEFAULT_KEY_SIZES.get(algorithm); in testInitWithKeySizeThrowsUnsupportedOperationException() 118 throw new RuntimeException("Failed for " + algorithm, e); in testInitWithKeySizeThrowsUnsupportedOperationException() 126 for (String algorithm : EXPECTED_ALGORITHMS) { in testInitWithKeySizeAndSecureRandomThrowsUnsupportedOperationException() 128 KeyGenerator keyGenerator = getKeyGenerator(algorithm); in testInitWithKeySizeAndSecureRandomThrowsUnsupportedOperationException() 129 int keySizeBits = DEFAULT_KEY_SIZES.get(algorithm); in testInitWithKeySizeAndSecureRandomThrowsUnsupportedOperationException() [all …]
|
| D | SignatureTest.java | 625 for (String algorithm : EXPECTED_SIGNATURE_ALGORITHMS) { in testSmallMsgKat() 627 byte[] goodSigBytes = SHORT_MSG_KAT_SIGNATURES.get(algorithm); in testSmallMsgKat() 629 KeyPair keyPair = importDefaultKatKeyPair(algorithm).getKeystoreBackedKeyPair(); in testSmallMsgKat() 632 algorithm, provider, keyPair.getPublic(), message, goodSigBytes); in testSmallMsgKat() 634 algorithm, provider, keyPair.getPublic(), message, goodSigBytes); in testSmallMsgKat() 636 algorithm, provider, keyPair.getPublic(), message, goodSigBytes, 3); in testSmallMsgKat() 641 algorithm, provider, keyPair.getPublic(), messageWithBitFlip, goodSigBytes); in testSmallMsgKat() 646 algorithm, provider, keyPair.getPublic(), message, goodSigWithBitFlip); in testSmallMsgKat() 649 Signature signature = Signature.getInstance(algorithm, provider); in testSmallMsgKat() 654 algorithm.toLowerCase().endsWith("withrsa"); in testSmallMsgKat() [all …]
|
| D | SecretKeyFactoryTest.java | 86 for (String algorithm : EXPECTED_ALGORITHMS) { in testGetKeySpecWithKeystoreKeyAndKeyInfoReflectsAllAuthorizations() 95 if (TestUtils.isHmacAlgorithm(algorithm)) { in testGetKeySpecWithKeystoreKeyAndKeyInfoReflectsAllAuthorizations() 96 String digest = TestUtils.getHmacAlgorithmDigest(algorithm); in testGetKeySpecWithKeystoreKeyAndKeyInfoReflectsAllAuthorizations() 104 KeyGenerator.getInstance(algorithm, EXPECTED_PROVIDER_NAME); in testGetKeySpecWithKeystoreKeyAndKeyInfoReflectsAllAuthorizations() 114 SecretKeyFactory keyFactory = getKeyFactory(algorithm); in testGetKeySpecWithKeystoreKeyAndKeyInfoReflectsAllAuthorizations() 132 throw new RuntimeException("Failed for " + algorithm, e); in testGetKeySpecWithKeystoreKeyAndKeyInfoReflectsAllAuthorizations() 138 for (String algorithm : EXPECTED_ALGORITHMS) { in testTranslateKeyWithNullKeyThrowsInvalidKeyException() 140 SecretKeyFactory keyFactory = getKeyFactory(algorithm); in testTranslateKeyWithNullKeyThrowsInvalidKeyException() 146 throw new RuntimeException("Failed for " + algorithm, e); in testTranslateKeyWithNullKeyThrowsInvalidKeyException() 152 for (String algorithm : EXPECTED_ALGORITHMS) { in testTranslateKeyRejectsNonAndroidKeystoreKeys() [all …]
|
| D | CipherTest.java | 254 for (String algorithm : EXPECTED_ALGORITHMS) { in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() 257 algorithm, in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() 263 Cipher cipher = Cipher.getInstance(algorithm, provider); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() 268 cipher = Cipher.getInstance(algorithm); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() 274 cipher = Cipher.getInstance(algorithm); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() 282 throw new RuntimeException("Failed for " + algorithm, e); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() 291 for (String algorithm : EXPECTED_ALGORITHMS) { in testAndroidKeyStorePublicKeysAcceptedByHighestPriorityProviderWhenEncrypting() 292 if (isSymmetric(algorithm)) { in testAndroidKeyStorePublicKeysAcceptedByHighestPriorityProviderWhenEncrypting() 297 algorithm, in testAndroidKeyStorePublicKeysAcceptedByHighestPriorityProviderWhenEncrypting() 301 Cipher cipher = Cipher.getInstance(algorithm); in testAndroidKeyStorePublicKeysAcceptedByHighestPriorityProviderWhenEncrypting() [all …]
|
| D | RSASignatureTest.java | 46 for (String algorithm : SignatureTest.EXPECTED_SIGNATURE_ALGORITHMS) { 47 String keyAlgorithm = TestUtils.getSignatureAlgorithmKeyAlgorithm(algorithm); 49 sigAlgs.add(algorithm); 110 for (String algorithm : SIGNATURE_ALGORITHMS) { in testSmallKeyRejected() 112 String digest = TestUtils.getSignatureAlgorithmDigest(algorithm); in testSmallKeyRejected() 128 TestUtils.getMinimalWorkingImportParametersForSigningingWith(algorithm)) in testSmallKeyRejected() 133 Signature signature = Signature.getInstance(algorithm, provider); in testSmallKeyRejected() 145 throw new RuntimeException("Failed for " + algorithm, e); in testSmallKeyRejected()
|
| D | TransparentSecretKey.java | 31 public TransparentSecretKey(byte[] keyMaterial, String algorithm) { in TransparentSecretKey() argument 32 mAlgorithm = algorithm; in TransparentSecretKey()
|
| D | KeyPairGeneratorTest.java | 214 for (String algorithm : EXPECTED_ALGORITHMS) { in testDefaultKeySize() 216 int expectedSizeBits = DEFAULT_KEY_SIZES.get(algorithm); in testDefaultKeySize() 217 KeyPairGenerator generator = getGenerator(algorithm); in testDefaultKeySize() 223 throw new RuntimeException("Failed for " + algorithm, e); in testDefaultKeySize() 229 for (String algorithm : EXPECTED_ALGORITHMS) { in testInitWithUnknownBlockModeFails() 231 KeyPairGenerator generator = getGenerator(algorithm); in testInitWithUnknownBlockModeFails() 237 throw new RuntimeException("Failed for " + algorithm, e); in testInitWithUnknownBlockModeFails() 243 for (String algorithm : EXPECTED_ALGORITHMS) { in testInitWithUnknownEncryptionPaddingFails() 245 KeyPairGenerator generator = getGenerator(algorithm); in testInitWithUnknownEncryptionPaddingFails() 251 throw new RuntimeException("Failed for " + algorithm, e); in testInitWithUnknownEncryptionPaddingFails() [all …]
|
| D | TestUtils.java | 605 static boolean isHmacAlgorithm(String algorithm) { in isHmacAlgorithm() argument 606 return algorithm.toUpperCase(Locale.US).startsWith("HMAC"); in isHmacAlgorithm() 609 static String getHmacAlgorithmDigest(String algorithm) { in getHmacAlgorithmDigest() argument 610 String algorithmUpperCase = algorithm.toUpperCase(Locale.US); in getHmacAlgorithmDigest() 691 static String getSignatureAlgorithmDigest(String algorithm) { in getSignatureAlgorithmDigest() argument 692 String algorithmUpperCase = algorithm.toUpperCase(Locale.US); in getSignatureAlgorithmDigest() 695 throw new IllegalArgumentException("Unsupported algorithm: " + algorithm); in getSignatureAlgorithmDigest() 704 static String getSignatureAlgorithmPadding(String algorithm) { in getSignatureAlgorithmPadding() argument 705 String algorithmUpperCase = algorithm.toUpperCase(Locale.US); in getSignatureAlgorithmPadding() 713 throw new IllegalArgumentException("Unsupported algorithm: " + algorithm); in getSignatureAlgorithmPadding() [all …]
|
| D | AuthorizationList.java | 154 private Integer algorithm; field in AuthorizationList 196 algorithm = Asn1Utils.getIntegerFromAsn1(value); in AuthorizationList() 264 public static String algorithmToString(int algorithm) { in algorithmToString() argument 265 switch (algorithm) { in algorithmToString() 353 return algorithm; in getAlgorithm() 488 if (algorithm != null) { in toString() 489 s.append("\nAlgorithm: ").append(algorithmToString(algorithm)); in toString()
|
| D | AndroidKeyStoreTest.java | 2411 for (String algorithm : KeyGeneratorTest.EXPECTED_ALGORITHMS) { in testKeyStore_OnlyOneDigestCanBeAuthorized_HMAC() 2412 if (!TestUtils.isHmacAlgorithm(algorithm)) { in testKeyStore_OnlyOneDigestCanBeAuthorized_HMAC() 2416 String digest = TestUtils.getHmacAlgorithmDigest(algorithm); in testKeyStore_OnlyOneDigestCanBeAuthorized_HMAC() 2418 SecretKey keyBeingImported = new TransparentSecretKey(new byte[16], algorithm); in testKeyStore_OnlyOneDigestCanBeAuthorized_HMAC() 2465 throw new RuntimeException("Failed for " + algorithm, e); in testKeyStore_OnlyOneDigestCanBeAuthorized_HMAC() 2511 for (String algorithm : KeyGeneratorTest.EXPECTED_ALGORITHMS) { in testKeyStore_ImportSupportedSizes_HMAC() 2512 if (!TestUtils.isHmacAlgorithm(algorithm)) { in testKeyStore_ImportSupportedSizes_HMAC() 2518 new TransparentSecretKey(new byte[keySizeBytes], algorithm)); in testKeyStore_ImportSupportedSizes_HMAC() 2522 assertEquals(algorithm, key.getAlgorithm()); in testKeyStore_ImportSupportedSizes_HMAC() 2534 "Failed for " + algorithm + " with key size " + (keySizeBytes * 8), e); in testKeyStore_ImportSupportedSizes_HMAC()
|
| D | KeyAttestationTest.java | 808 private void generateKey(KeyGenParameterSpec spec, String algorithm) in generateKey() argument 811 KeyGenerator keyGenerator = KeyGenerator.getInstance(algorithm, "AndroidKeyStore"); in generateKey() 816 private void generateKeyPair(String algorithm, KeyGenParameterSpec spec) in generateKeyPair() argument 819 KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(algorithm, in generateKeyPair()
|
| D | KeyStoreTest.java | 171 String algorithm = service.getAlgorithm(); in keyStores() local 172 KeyStore ks = KeyStore.getInstance(algorithm, provider); in keyStores() 174 assertEquals(algorithm, ks.getType()); in keyStores() 447 String algorithm = service.getAlgorithm(); in test_KeyStore_create() local 448 KeyStore ks = KeyStore.getInstance(algorithm, provider); in test_KeyStore_create() 450 assertEquals(algorithm, ks.getType()); in test_KeyStore_create()
|
| /cts/common/device-side/device-info/src/com/android/compatibility/common/deviceinfo/ |
| D | LibraryDeviceInfo.java | 112 private static byte[] digest(InputStream in, String algorithm) in digest() argument 114 MessageDigest digest = MessageDigest.getInstance(algorithm); in digest()
|
| /cts/tools/tradefed-host/src/com/android/cts/tradefed/testtype/ |
| D | TestPackageDef.java | 403 final String algorithm = "SHA-1"; in generateDigest() local 408 MessageDigest md = MessageDigest.getInstance(algorithm); in generateDigest() 415 return algorithm + " not found"; in generateDigest()
|
| /cts/libs/testserver/src/android/webkit/cts/ |
| D | TestWebServer.java | 540 String algorithm = KeyManagerFactory.getDefaultAlgorithm(); in getKeyManagers() local 541 KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(algorithm); in getKeyManagers()
|
| D | CtsTestServer.java | 908 String algorithm = KeyManagerFactory.getDefaultAlgorithm(); in getKeyManagers() local 909 KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(algorithm); in getKeyManagers()
|
| /cts/tools/dex-tools/dex/ |
| D | classes0.out.dex | 31134 private final java.lang.String algorithm 31210 private java.lang.String algorithm 32077 private java.lang.String algorithm 32230 private java.lang.String algorithm 32360 private final java.lang.String algorithm 32947 private java.lang.String algorithm 33326 private java.lang.String algorithm 33503 private java.lang.String algorithm 33801 private java.lang.String algorithm 34507 private final java.lang.String algorithm [all …]
|