Home
last modified time | relevance | path

Searched refs:algorithm (Results 1 – 19 of 19) 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.java104 for (String algorithm : EXPECTED_ALGORITHMS) { in testGenerateWithoutInitThrowsIllegalStateException()
106 KeyGenerator keyGenerator = getKeyGenerator(algorithm); in testGenerateWithoutInitThrowsIllegalStateException()
112 throw new RuntimeException("Failed for " + algorithm, e); in testGenerateWithoutInitThrowsIllegalStateException()
118 for (String algorithm : EXPECTED_ALGORITHMS) { in testInitWithKeySizeThrowsUnsupportedOperationException()
120 KeyGenerator keyGenerator = getKeyGenerator(algorithm); in testInitWithKeySizeThrowsUnsupportedOperationException()
121 int keySizeBits = DEFAULT_KEY_SIZES.get(algorithm); in testInitWithKeySizeThrowsUnsupportedOperationException()
127 throw new RuntimeException("Failed for " + algorithm, e); in testInitWithKeySizeThrowsUnsupportedOperationException()
135 for (String algorithm : EXPECTED_ALGORITHMS) { in testInitWithKeySizeAndSecureRandomThrowsUnsupportedOperationException()
137 KeyGenerator keyGenerator = getKeyGenerator(algorithm); in testInitWithKeySizeAndSecureRandomThrowsUnsupportedOperationException()
138 int keySizeBits = DEFAULT_KEY_SIZES.get(algorithm); in testInitWithKeySizeAndSecureRandomThrowsUnsupportedOperationException()
[all …]
DSignatureTest.java625 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 …]
DSecretKeyFactoryTest.java94 for (String algorithm : EXPECTED_ALGORITHMS) { in testGetKeySpecWithKeystoreKeyAndKeyInfoReflectsAllAuthorizations()
103 if (TestUtils.isHmacAlgorithm(algorithm)) { in testGetKeySpecWithKeystoreKeyAndKeyInfoReflectsAllAuthorizations()
104 String digest = TestUtils.getHmacAlgorithmDigest(algorithm); in testGetKeySpecWithKeystoreKeyAndKeyInfoReflectsAllAuthorizations()
112 KeyGenerator.getInstance(algorithm, EXPECTED_PROVIDER_NAME); in testGetKeySpecWithKeystoreKeyAndKeyInfoReflectsAllAuthorizations()
122 SecretKeyFactory keyFactory = getKeyFactory(algorithm); in testGetKeySpecWithKeystoreKeyAndKeyInfoReflectsAllAuthorizations()
140 throw new RuntimeException("Failed for " + algorithm, e); in testGetKeySpecWithKeystoreKeyAndKeyInfoReflectsAllAuthorizations()
146 for (String algorithm : EXPECTED_ALGORITHMS) { in testTranslateKeyWithNullKeyThrowsInvalidKeyException()
148 SecretKeyFactory keyFactory = getKeyFactory(algorithm); in testTranslateKeyWithNullKeyThrowsInvalidKeyException()
154 throw new RuntimeException("Failed for " + algorithm, e); in testTranslateKeyWithNullKeyThrowsInvalidKeyException()
160 for (String algorithm : EXPECTED_ALGORITHMS) { in testTranslateKeyRejectsNonAndroidKeystoreKeys()
[all …]
DCipherTest.java324 for (String algorithm : EXPECTED_ALGORITHMS) { in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting()
327 algorithm, in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting()
333 Cipher cipher = Cipher.getInstance(algorithm, provider); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting()
338 cipher = Cipher.getInstance(algorithm); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting()
344 cipher = Cipher.getInstance(algorithm); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting()
352 throw new RuntimeException("Failed for " + algorithm, e); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting()
361 for (String algorithm : EXPECTED_ALGORITHMS) { in testAndroidKeyStorePublicKeysAcceptedByHighestPriorityProviderWhenEncrypting()
362 if (isSymmetric(algorithm)) { in testAndroidKeyStorePublicKeysAcceptedByHighestPriorityProviderWhenEncrypting()
367 algorithm, in testAndroidKeyStorePublicKeysAcceptedByHighestPriorityProviderWhenEncrypting()
371 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.java214 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 …]
DTestUtils.java625 static boolean isHmacAlgorithm(String algorithm) { in isHmacAlgorithm() argument
626 return algorithm.toUpperCase(Locale.US).startsWith("HMAC"); in isHmacAlgorithm()
629 static String getHmacAlgorithmDigest(String algorithm) { in getHmacAlgorithmDigest() argument
630 String algorithmUpperCase = algorithm.toUpperCase(Locale.US); in getHmacAlgorithmDigest()
714 static String getSignatureAlgorithmDigest(String algorithm) { in getSignatureAlgorithmDigest() argument
715 String algorithmUpperCase = algorithm.toUpperCase(Locale.US); in getSignatureAlgorithmDigest()
718 throw new IllegalArgumentException("Unsupported algorithm: " + algorithm); in getSignatureAlgorithmDigest()
727 static String getSignatureAlgorithmPadding(String algorithm) { in getSignatureAlgorithmPadding() argument
728 String algorithmUpperCase = algorithm.toUpperCase(Locale.US); in getSignatureAlgorithmPadding()
736 throw new IllegalArgumentException("Unsupported algorithm: " + algorithm); in getSignatureAlgorithmPadding()
[all …]
DAndroidKeyStoreTest.java2424 for (String algorithm : KeyGeneratorTest.EXPECTED_ALGORITHMS) { in testKeyStore_OnlyOneDigestCanBeAuthorized_HMAC()
2425 if (!TestUtils.isHmacAlgorithm(algorithm)) { in testKeyStore_OnlyOneDigestCanBeAuthorized_HMAC()
2429 String digest = TestUtils.getHmacAlgorithmDigest(algorithm); in testKeyStore_OnlyOneDigestCanBeAuthorized_HMAC()
2431 SecretKey keyBeingImported = new TransparentSecretKey(new byte[16], algorithm); in testKeyStore_OnlyOneDigestCanBeAuthorized_HMAC()
2478 throw new RuntimeException("Failed for " + algorithm, e); in testKeyStore_OnlyOneDigestCanBeAuthorized_HMAC()
2526 for (String algorithm : KeyGeneratorTest.EXPECTED_ALGORITHMS) { in testKeyStore_ImportSupportedSizes_HMAC()
2527 if (!TestUtils.isHmacAlgorithm(algorithm)) { in testKeyStore_ImportSupportedSizes_HMAC()
2533 new TransparentSecretKey(new byte[keySizeBytes], algorithm)); in testKeyStore_ImportSupportedSizes_HMAC()
2537 assertEquals(algorithm, key.getAlgorithm()); in testKeyStore_ImportSupportedSizes_HMAC()
2549 "Failed for " + algorithm + " with key size " + (keySizeBytes * 8), e); in testKeyStore_ImportSupportedSizes_HMAC()
DImportWrappedKeyTest.java308 DERTaggedObject algorithm = new DERTaggedObject(true, 2, new DERInteger(algorithm_)); in makeAuthList() local
329 allItems.add(algorithm); in makeAuthList()
DKeyAttestationTest.java866 private void generateKey(KeyGenParameterSpec spec, String algorithm) in generateKey() argument
869 KeyGenerator keyGenerator = KeyGenerator.getInstance(algorithm, "AndroidKeyStore"); in generateKey()
874 private void generateKeyPair(String algorithm, KeyGenParameterSpec spec) in generateKeyPair() argument
877 KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(algorithm, in generateKeyPair()
DKeyStoreTest.java173 String algorithm = service.getAlgorithm(); in keyStores() local
174 KeyStore ks = KeyStore.getInstance(algorithm, provider); in keyStores()
176 assertEquals(algorithm, ks.getType()); in keyStores()
450 String algorithm = service.getAlgorithm(); in test_KeyStore_create() local
451 KeyStore ks = KeyStore.getInstance(algorithm, provider); in test_KeyStore_create()
453 assertEquals(algorithm, ks.getType()); in test_KeyStore_create()
/cts/tests/security/src/android/keystore/cts/
DAuthorizationList.java165 private Integer algorithm; field in AuthorizationList
216 algorithm = Asn1Utils.getIntegerFromAsn1(value); in AuthorizationList()
312 public static String algorithmToString(int algorithm) { in algorithmToString() argument
313 switch (algorithm) { in algorithmToString()
401 return algorithm; in getAlgorithm()
580 if (algorithm != null) { in toString()
581 s.append("\nAlgorithm: ").append(algorithmToString(algorithm)); in toString()
/cts/hostsidetests/appsecurity/res/pkgsigverify/
DREADME.txt7 ${version}-with-${signing-algorithm}-${OID-params}-${keysize}-${extra_info}
12 signing-algorithm: indicates how the signature was generated
/cts/tests/autofillservice/src/android/autofillservice/cts/
DFieldsClassificationTest.java163 private void simpleHitTest(boolean setAlgorithm, String algorithm) throws Exception { in simpleHitTest() argument
170 userData.setFieldClassificationAlgorithm(algorithm, null); in simpleHitTest()
/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.java909 String algorithm = KeyManagerFactory.getDefaultAlgorithm(); in getKeyManagers() local
910 KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(algorithm); in getKeyManagers()