Home
last modified time | relevance | path

Searched refs:algorithm (Results 1 – 15 of 15) sorted by relevance

/cts/tests/tests/keystore/src/android/keystore/cts/
DMacTest.java212 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 …]
DKeyFactoryTest.java98 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 …]
DKeyGeneratorTest.java95 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 …]
DSignatureTest.java626 for (String algorithm : EXPECTED_SIGNATURE_ALGORITHMS) { in testSmallMsgKat()
628 byte[] goodSigBytes = SHORT_MSG_KAT_SIGNATURES.get(algorithm); in testSmallMsgKat()
630 KeyPair keyPair = importDefaultKatKeyPair(algorithm).getKeystoreBackedKeyPair(); in testSmallMsgKat()
633 algorithm, provider, keyPair.getPublic(), message, goodSigBytes); in testSmallMsgKat()
635 algorithm, provider, keyPair.getPublic(), message, goodSigBytes); in testSmallMsgKat()
637 algorithm, provider, keyPair.getPublic(), message, goodSigBytes, 3); in testSmallMsgKat()
642 algorithm, provider, keyPair.getPublic(), messageWithBitFlip, goodSigBytes); in testSmallMsgKat()
647 algorithm, provider, keyPair.getPublic(), message, goodSigWithBitFlip); in testSmallMsgKat()
650 Signature signature = Signature.getInstance(algorithm, provider); in testSmallMsgKat()
655 algorithm.toLowerCase().endsWith("withrsa"); in testSmallMsgKat()
[all …]
DSecretKeyFactoryTest.java86 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 …]
DCipherTest.java252 for (String algorithm : EXPECTED_ALGORITHMS) { in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting()
255 algorithm, in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting()
261 Cipher cipher = Cipher.getInstance(algorithm, provider); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting()
266 cipher = Cipher.getInstance(algorithm); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting()
272 cipher = Cipher.getInstance(algorithm); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting()
280 throw new RuntimeException("Failed for " + algorithm, e); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting()
289 for (String algorithm : EXPECTED_ALGORITHMS) { in testAndroidKeyStorePublicKeysAcceptedByHighestPriorityProviderWhenEncrypting()
290 if (isSymmetric(algorithm)) { in testAndroidKeyStorePublicKeysAcceptedByHighestPriorityProviderWhenEncrypting()
295 algorithm, in testAndroidKeyStorePublicKeysAcceptedByHighestPriorityProviderWhenEncrypting()
299 Cipher cipher = Cipher.getInstance(algorithm); in testAndroidKeyStorePublicKeysAcceptedByHighestPriorityProviderWhenEncrypting()
[all …]
DRSASignatureTest.java46 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()
DTransparentSecretKey.java31 public TransparentSecretKey(byte[] keyMaterial, String algorithm) { in TransparentSecretKey() argument
32 mAlgorithm = algorithm; in TransparentSecretKey()
DKeyPairGeneratorTest.java213 for (String algorithm : EXPECTED_ALGORITHMS) { in testDefaultKeySize()
215 int expectedSizeBits = DEFAULT_KEY_SIZES.get(algorithm); in testDefaultKeySize()
216 KeyPairGenerator generator = getGenerator(algorithm); in testDefaultKeySize()
222 throw new RuntimeException("Failed for " + algorithm, e); in testDefaultKeySize()
228 for (String algorithm : EXPECTED_ALGORITHMS) { in testInitWithUnknownBlockModeFails()
230 KeyPairGenerator generator = getGenerator(algorithm); in testInitWithUnknownBlockModeFails()
236 throw new RuntimeException("Failed for " + algorithm, e); in testInitWithUnknownBlockModeFails()
242 for (String algorithm : EXPECTED_ALGORITHMS) { in testInitWithUnknownEncryptionPaddingFails()
244 KeyPairGenerator generator = getGenerator(algorithm); in testInitWithUnknownEncryptionPaddingFails()
250 throw new RuntimeException("Failed for " + algorithm, e); in testInitWithUnknownEncryptionPaddingFails()
[all …]
DTestUtils.java605 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 …]
DAndroidKeyStoreTest.java2401 for (String algorithm : KeyGeneratorTest.EXPECTED_ALGORITHMS) { in testKeyStore_OnlyOneDigestCanBeAuthorized_HMAC()
2402 if (!TestUtils.isHmacAlgorithm(algorithm)) { in testKeyStore_OnlyOneDigestCanBeAuthorized_HMAC()
2406 String digest = TestUtils.getHmacAlgorithmDigest(algorithm); in testKeyStore_OnlyOneDigestCanBeAuthorized_HMAC()
2408 SecretKey keyBeingImported = new TransparentSecretKey(new byte[16], algorithm); in testKeyStore_OnlyOneDigestCanBeAuthorized_HMAC()
2455 throw new RuntimeException("Failed for " + algorithm, e); in testKeyStore_OnlyOneDigestCanBeAuthorized_HMAC()
2501 for (String algorithm : KeyGeneratorTest.EXPECTED_ALGORITHMS) { in testKeyStore_ImportSupportedSizes_HMAC()
2502 if (!TestUtils.isHmacAlgorithm(algorithm)) { in testKeyStore_ImportSupportedSizes_HMAC()
2508 new TransparentSecretKey(new byte[keySizeBytes], algorithm)); in testKeyStore_ImportSupportedSizes_HMAC()
2512 assertEquals(algorithm, key.getAlgorithm()); in testKeyStore_ImportSupportedSizes_HMAC()
2524 "Failed for " + algorithm + " with key size " + (keySizeBytes * 8), e); in testKeyStore_ImportSupportedSizes_HMAC()
/cts/tools/tradefed-host/src/com/android/cts/tradefed/testtype/
DTestPackageDef.java423 final String algorithm = "SHA-1"; in generateDigest() local
428 MessageDigest md = MessageDigest.getInstance(algorithm); in generateDigest()
435 return algorithm + " not found"; in generateDigest()
/cts/libs/testserver/src/android/webkit/cts/
DTestWebServer.java540 String algorithm = KeyManagerFactory.getDefaultAlgorithm(); in getKeyManagers() local
541 KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(algorithm); in getKeyManagers()
DCtsTestServer.java975 String algorithm = KeyManagerFactory.getDefaultAlgorithm(); in getKeyManagers() local
976 KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(algorithm); in getKeyManagers()
/cts/tools/dex-tools/dex/
Dclasses0.out.dex31134 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 …]