/cts/tests/tests/keystore/src/android/keystore/cts/ |
D | MacTest.java | 258 for (String algorithm : expectedAlgorithms()) { in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProvider() 260 SecretKey key = importDefaultKatKey(algorithm); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProvider() 263 Mac mac = Mac.getInstance(algorithm); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProvider() 267 throw new RuntimeException(algorithm + " failed", e); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProvider() 276 for (String algorithm : expectedAlgorithms()) { in testMacGeneratedForEmptyMessage() 278 SecretKey key = importDefaultKatKey(algorithm); in testMacGeneratedForEmptyMessage() 281 Mac mac = Mac.getInstance(algorithm, provider); in testMacGeneratedForEmptyMessage() 289 throw new RuntimeException(algorithm + " failed", e); in testMacGeneratedForEmptyMessage() 298 for (String algorithm : expectedAlgorithms()) { in testMacGeneratedByAndroidKeyStoreVerifiesByAndroidKeyStore() 300 SecretKey key = importDefaultKatKey(algorithm); in testMacGeneratedByAndroidKeyStoreVerifiesByAndroidKeyStore() [all …]
|
D | KeyFactoryTest.java | 123 for (String algorithm : EXPECTED_ALGORITHMS) { in testGetKeySpecWithKeystorePrivateKeyAndKeyInfoReflectsAllAuthorizations() 135 KeyPairGenerator.getInstance(algorithm, EXPECTED_PROVIDER_NAME); in testGetKeySpecWithKeystorePrivateKeyAndKeyInfoReflectsAllAuthorizations() 145 KeyFactory keyFactory = getKeyFactory(algorithm); in testGetKeySpecWithKeystorePrivateKeyAndKeyInfoReflectsAllAuthorizations() 174 throw new RuntimeException("Failed for " + algorithm, e); in testGetKeySpecWithKeystorePrivateKeyAndKeyInfoReflectsAllAuthorizations() 182 for (String algorithm : EXPECTED_ALGORITHMS) { in testGetKeySpecWithKeystorePublicKeyRejectsKeyInfo() 185 KeyPairGenerator.getInstance(algorithm, EXPECTED_PROVIDER_NAME); in testGetKeySpecWithKeystorePublicKeyRejectsKeyInfo() 188 KeyFactory keyFactory = getKeyFactory(algorithm); in testGetKeySpecWithKeystorePublicKeyRejectsKeyInfo() 194 throw new RuntimeException("Failed for " + algorithm, e); in testGetKeySpecWithKeystorePublicKeyRejectsKeyInfo() 202 for (String algorithm : EXPECTED_ALGORITHMS) { in testGetKeySpecWithKeystorePrivateKeyRejectsTransparentKeySpecAndEncodedKeySpec() 205 if ("EC".equalsIgnoreCase(algorithm)) { in testGetKeySpecWithKeystorePrivateKeyRejectsTransparentKeySpecAndEncodedKeySpec() [all …]
|
D | SignatureTest.java | 662 for (String algorithm : EXPECTED_SIGNATURE_ALGORITHMS) { in testSmallMsgKat() 664 byte[] goodSigBytes = SHORT_MSG_KAT_SIGNATURES.get(algorithm); in testSmallMsgKat() 666 KeyPair keyPair = importDefaultKatKeyPair(algorithm).getKeystoreBackedKeyPair(); in testSmallMsgKat() 669 algorithm, provider, keyPair.getPublic(), message, goodSigBytes); in testSmallMsgKat() 671 algorithm, provider, keyPair.getPublic(), message, goodSigBytes); in testSmallMsgKat() 673 algorithm, provider, keyPair.getPublic(), message, goodSigBytes, 3); in testSmallMsgKat() 678 algorithm, provider, keyPair.getPublic(), messageWithBitFlip, goodSigBytes); in testSmallMsgKat() 683 algorithm, provider, keyPair.getPublic(), message, goodSigWithBitFlip); in testSmallMsgKat() 686 Signature signature = Signature.getInstance(algorithm, provider); in testSmallMsgKat() 691 algorithm.toLowerCase().endsWith("withrsa"); in testSmallMsgKat() [all …]
|
D | SecretKeyFactoryTest.java | 104 for (String algorithm : EXPECTED_ALGORITHMS) { in testGetKeySpecWithKeystoreKeyAndKeyInfoReflectsAllAuthorizations() 113 if (TestUtils.isHmacAlgorithm(algorithm)) { in testGetKeySpecWithKeystoreKeyAndKeyInfoReflectsAllAuthorizations() 114 String digest = TestUtils.getHmacAlgorithmDigest(algorithm); in testGetKeySpecWithKeystoreKeyAndKeyInfoReflectsAllAuthorizations() 122 KeyGenerator.getInstance(algorithm, EXPECTED_PROVIDER_NAME); in testGetKeySpecWithKeystoreKeyAndKeyInfoReflectsAllAuthorizations() 132 SecretKeyFactory keyFactory = getKeyFactory(algorithm); in testGetKeySpecWithKeystoreKeyAndKeyInfoReflectsAllAuthorizations() 150 throw new RuntimeException("Failed for " + algorithm, e); in testGetKeySpecWithKeystoreKeyAndKeyInfoReflectsAllAuthorizations() 157 for (String algorithm : EXPECTED_ALGORITHMS) { in testTranslateKeyWithNullKeyThrowsInvalidKeyException() 159 SecretKeyFactory keyFactory = getKeyFactory(algorithm); in testTranslateKeyWithNullKeyThrowsInvalidKeyException() 165 throw new RuntimeException("Failed for " + algorithm, e); in testTranslateKeyWithNullKeyThrowsInvalidKeyException() 172 for (String algorithm : EXPECTED_ALGORITHMS) { in testTranslateKeyRejectsNonAndroidKeystoreKeys() [all …]
|
D | KeyGeneratorTest.java | 135 for (String algorithm : EXPECTED_ALGORITHMS) { in testGenerateWithoutInitThrowsIllegalStateException() 137 KeyGenerator keyGenerator = getKeyGenerator(algorithm); in testGenerateWithoutInitThrowsIllegalStateException() 143 throw new RuntimeException("Failed for " + algorithm, e); in testGenerateWithoutInitThrowsIllegalStateException() 150 for (String algorithm : EXPECTED_ALGORITHMS) { in testInitWithKeySizeThrowsUnsupportedOperationException() 152 KeyGenerator keyGenerator = getKeyGenerator(algorithm); in testInitWithKeySizeThrowsUnsupportedOperationException() 153 int keySizeBits = DEFAULT_KEY_SIZES.get(algorithm); in testInitWithKeySizeThrowsUnsupportedOperationException() 159 throw new RuntimeException("Failed for " + algorithm, e); in testInitWithKeySizeThrowsUnsupportedOperationException() 168 for (String algorithm : EXPECTED_ALGORITHMS) { in testInitWithKeySizeAndSecureRandomThrowsUnsupportedOperationException() 170 KeyGenerator keyGenerator = getKeyGenerator(algorithm); in testInitWithKeySizeAndSecureRandomThrowsUnsupportedOperationException() 171 int keySizeBits = DEFAULT_KEY_SIZES.get(algorithm); in testInitWithKeySizeAndSecureRandomThrowsUnsupportedOperationException() [all …]
|
D | CipherTest.java | 385 for (String algorithm : EXPECTED_ALGORITHMS) { in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() 388 algorithm, in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() 394 Cipher cipher = Cipher.getInstance(algorithm, provider); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() 399 cipher = Cipher.getInstance(algorithm); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() 405 cipher = Cipher.getInstance(algorithm); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() 413 throw new RuntimeException("Failed for " + algorithm, e); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() 423 for (String algorithm : EXPECTED_ALGORITHMS) { in testAndroidKeyStorePublicKeysAcceptedByHighestPriorityProviderWhenEncrypting() 424 if (isSymmetric(algorithm)) { in testAndroidKeyStorePublicKeysAcceptedByHighestPriorityProviderWhenEncrypting() 429 algorithm, in testAndroidKeyStorePublicKeysAcceptedByHighestPriorityProviderWhenEncrypting() 433 Cipher cipher = Cipher.getInstance(algorithm); in testAndroidKeyStorePublicKeysAcceptedByHighestPriorityProviderWhenEncrypting() [all …]
|
D | RSASignatureTest.java | 57 for (String algorithm : SignatureTest.EXPECTED_SIGNATURE_ALGORITHMS) { 58 String keyAlgorithm = TestUtils.getSignatureAlgorithmKeyAlgorithm(algorithm); 60 sigAlgs.add(algorithm); 128 for (String algorithm : SIGNATURE_ALGORITHMS) { in testSmallKeyRejected() 130 String digest = TestUtils.getSignatureAlgorithmDigest(algorithm); in testSmallKeyRejected() 146 TestUtils.getMinimalWorkingImportParametersForSigningingWith(algorithm)) in testSmallKeyRejected() 151 Signature signature = Signature.getInstance(algorithm, provider); in testSmallKeyRejected() 163 throw new RuntimeException("Failed for " + algorithm, e); in testSmallKeyRejected()
|
D | NoAttestKeyTest.java | 95 private void testAttestKeyFail(boolean useStrongBox, String algorithm) throws Exception { in testAttestKeyFail() argument 106 Certificate[] attestKeyCertChain = generateKeyPair(algorithm, in testAttestKeyFail() 117 + useStrongBox + " and algorithm = " + algorithm + " as the " in testAttestKeyFail() 132 private Certificate[] generateKeyPair(String algorithm, KeyGenParameterSpec spec) in generateKeyPair() argument 135 KeyPairGenerator.getInstance(algorithm, "AndroidKeyStore"); in generateKeyPair()
|
D | TransparentSecretKey.java | 31 public TransparentSecretKey(byte[] keyMaterial, String algorithm) { in TransparentSecretKey() argument 32 mAlgorithm = algorithm; in TransparentSecretKey()
|
D | KeyPairGeneratorTest.java | 261 for (String algorithm : EXPECTED_ALGORITHMS) { in testDefaultKeySize() 264 int expectedSizeBits = DEFAULT_KEY_SIZES.get(algorithm); in testDefaultKeySize() 265 KeyPairGenerator generator = getGenerator(algorithm); in testDefaultKeySize() 271 throw new RuntimeException("Failed for " + algorithm, e); in testDefaultKeySize() 273 strict.check(algorithm + " keypair generation"); in testDefaultKeySize() 279 for (String algorithm : EXPECTED_ALGORITHMS) { in testInitWithUnknownBlockModeFails() 281 KeyPairGenerator generator = getGenerator(algorithm); in testInitWithUnknownBlockModeFails() 287 throw new RuntimeException("Failed for " + algorithm, e); in testInitWithUnknownBlockModeFails() 294 for (String algorithm : EXPECTED_ALGORITHMS) { in testInitWithUnknownEncryptionPaddingFails() 296 KeyPairGenerator generator = getGenerator(algorithm); in testInitWithUnknownEncryptionPaddingFails() [all …]
|
/cts/tests/tests/keystore/src/android/keystore/cts/performance/ |
D | RsaCipherPerformanceTest.java | 56 private void testRsaCipher(String algorithm, int[] keySizes, int[] messageSizes) in testRsaCipher() argument 60 TestUtils.getMaxSupportedPlaintextInputSizeBytes(algorithm, keySize); in testRsaCipher() 67 new AndroidKeystoreRsaKeyGenerator(algorithm, keySize), in testRsaCipher() 71 new AndroidKeystoreRsaKeyGenerator(algorithm, keySize), in testRsaCipher() 75 new DefaultKeystoreKeyPairGenerator(algorithm, keySize), in testRsaCipher() 79 new DefaultKeystoreKeyPairGenerator(algorithm, keySize), in testRsaCipher() 88 AndroidKeystoreRsaKeyGenerator(String algorithm, int keySize) throws Exception { in AndroidKeystoreRsaKeyGenerator() argument 89 super(algorithm); in AndroidKeystoreRsaKeyGenerator() 90 String digest = TestUtils.getCipherDigest(algorithm); in AndroidKeystoreRsaKeyGenerator() 96 .setBlockModes(TestUtils.getCipherBlockMode(algorithm)) in AndroidKeystoreRsaKeyGenerator() [all …]
|
D | AttestationPerformanceTest.java | 71 AndroidKeystoreRsaKeyGenerator(String algorithm, int keySize, byte[] challenge) in AndroidKeystoreRsaKeyGenerator() argument 73 super(algorithm); in AndroidKeystoreRsaKeyGenerator() 81 TestUtils.getSignatureAlgorithmPadding(algorithm)) in AndroidKeystoreRsaKeyGenerator() 82 .setDigests(TestUtils.getSignatureAlgorithmDigest(algorithm)) in AndroidKeystoreRsaKeyGenerator() 90 AndroidKeystoreEcKeyGenerator(String algorithm, int keySize, byte[] challenge) in AndroidKeystoreEcKeyGenerator() argument 92 super(algorithm); in AndroidKeystoreEcKeyGenerator() 99 .setDigests(TestUtils.getSignatureAlgorithmDigest(algorithm)) in AndroidKeystoreEcKeyGenerator()
|
D | EcdsaSignaturePerformanceTest.java | 63 private void testEcdsaSign(String algorithm, int[] messageSizes) throws Exception { in testEcdsaSign() argument 66 new AndroidKeystoreEcKeyGenerator(algorithm, keySize); in testEcdsaSign() 68 new DefaultKeystoreEcKeyGenerator(algorithm, keySize); in testEcdsaSign() 85 DefaultKeystoreEcKeyGenerator(String algorithm, int keySize) throws Exception { in DefaultKeystoreEcKeyGenerator() argument 86 super(algorithm); in DefaultKeystoreEcKeyGenerator() 93 AndroidKeystoreEcKeyGenerator(String algorithm, int keySize) throws Exception { in AndroidKeystoreEcKeyGenerator() argument 94 super(algorithm); in AndroidKeystoreEcKeyGenerator() 101 .setDigests(TestUtils.getSignatureAlgorithmDigest(algorithm)) in AndroidKeystoreEcKeyGenerator()
|
D | EcKeyGenPerformanceTest.java | 46 AndroidKeystoreEcKeyGenerator(String algorithm, int keySize) throws Exception { in AndroidKeystoreEcKeyGenerator() argument 47 super(algorithm); in AndroidKeystoreEcKeyGenerator() 60 DefaultKeystoreEcKeyGenerator(String algorithm, int curve) throws Exception { in DefaultKeystoreEcKeyGenerator() argument 61 super(algorithm); in DefaultKeystoreEcKeyGenerator()
|
D | DesCipherPerformanceTest.java | 66 private void testDesCipher(String algorithm, int[] keySizes, int[] messageSizes) in testDesCipher() argument 70 new AndroidKeystoreDesKeyGenerator(algorithm, keySize); in testDesCipher() 72 new DefaultKeystoreSecretKeyGenerator(algorithm, keySize); in testDesCipher() 88 AndroidKeystoreDesKeyGenerator(String algorithm, int keySize) throws Exception { in AndroidKeystoreDesKeyGenerator() argument 89 super(algorithm); in AndroidKeystoreDesKeyGenerator() 95 .setBlockModes(TestUtils.getCipherBlockMode(algorithm)) in AndroidKeystoreDesKeyGenerator() 97 TestUtils.getCipherEncryptionPadding(algorithm)) in AndroidKeystoreDesKeyGenerator()
|
D | AesCipherPerformanceTest.java | 64 private void testAesCipher(String algorithm, int[] keySizes, int[] messageSizes) in testAesCipher() argument 68 new AndroidKeystoreAesKeyGenerator(algorithm, keySize); in testAesCipher() 70 new DefaultKeystoreSecretKeyGenerator(algorithm, keySize); in testAesCipher() 86 AndroidKeystoreAesKeyGenerator(String algorithm, int keySize) throws Exception { in AndroidKeystoreAesKeyGenerator() argument 87 super(algorithm); in AndroidKeystoreAesKeyGenerator() 93 .setBlockModes(TestUtils.getCipherBlockMode(algorithm)) in AndroidKeystoreAesKeyGenerator() 95 TestUtils.getCipherEncryptionPadding(algorithm)) in AndroidKeystoreAesKeyGenerator()
|
D | RsaSignaturePerformanceTest.java | 98 private void testRsaSign(String algorithm, int[] keySizes, int[] messageSizes) in testRsaSign() argument 101 if (!TestUtils.isKeyLongEnoughForSignatureAlgorithm(algorithm, keySize)) { in testRsaSign() 105 new AndroidKeystoreRsaKeyGenerator(algorithm, keySize); in testRsaSign() 107 new DefaultKeystoreKeyPairGenerator(algorithm, keySize); in testRsaSign() 124 AndroidKeystoreRsaKeyGenerator(String algorithm, int keySize) throws Exception { in AndroidKeystoreRsaKeyGenerator() argument 125 super(algorithm); in AndroidKeystoreRsaKeyGenerator() 133 TestUtils.getSignatureAlgorithmPadding(algorithm)) in AndroidKeystoreRsaKeyGenerator() 134 .setDigests(TestUtils.getSignatureAlgorithmDigest(algorithm)) in AndroidKeystoreRsaKeyGenerator()
|
D | HmacMacPerformanceTest.java | 56 private void testHmac(String algorithm, int[] keySizes, int[] messageSizes) throws Exception { in testHmac() argument 59 new AndroidKeystoreHmacKeyGenerator(algorithm, keySize); in testHmac() 61 new DefaultKeystoreSecretKeyGenerator(algorithm, keySize); in testHmac() 74 AndroidKeystoreHmacKeyGenerator(String algorithm, int keySize) throws Exception { in AndroidKeystoreHmacKeyGenerator() argument 75 super(algorithm); in AndroidKeystoreHmacKeyGenerator()
|
D | PerformanceTestBase.java | 285 KeystoreKeyGenerator(String algorithm, String provider) throws Exception { in KeystoreKeyGenerator() argument 286 mAlgorithm = algorithm; in KeystoreKeyGenerator() 290 KeystoreKeyGenerator(String algorithm) throws Exception { in KeystoreKeyGenerator() argument 292 this(algorithm, KeyGenerator.getInstance("AES").getProvider().getName()); in KeystoreKeyGenerator() 333 AndroidKeystoreKeyGenerator(String algorithm) throws Exception { in AndroidKeystoreKeyGenerator() argument 334 super(algorithm, TestUtils.EXPECTED_PROVIDER_NAME); in AndroidKeystoreKeyGenerator() 355 DefaultKeystoreKeyPairGenerator(String algorithm, int keySize) throws Exception { in DefaultKeystoreKeyPairGenerator() argument 356 super(algorithm); in DefaultKeystoreKeyPairGenerator() 363 DefaultKeystoreSecretKeyGenerator(String algorithm, int keySize) throws Exception { in DefaultKeystoreSecretKeyGenerator() argument 364 super(algorithm); in DefaultKeystoreSecretKeyGenerator()
|
D | DesKeyGenPerformanceTest.java | 44 AndroidKeystoreDesKeyGenerator(String algorithm, int keySize) throws Exception { in AndroidKeystoreDesKeyGenerator() argument 45 super(algorithm); in AndroidKeystoreDesKeyGenerator()
|
D | HmacKeyGenPerformanceTest.java | 44 AndroidKeystoreHmacKeyGenerator(String algorithm, int keySize) throws Exception { in AndroidKeystoreHmacKeyGenerator() argument 45 super(algorithm); in AndroidKeystoreHmacKeyGenerator()
|
D | AesKeyGenPerformanceTest.java | 44 AndroidKeystoreAesKeyGenerator(String algorithm, int keySize) throws Exception { in AndroidKeystoreAesKeyGenerator() argument 45 super(algorithm); in AndroidKeystoreAesKeyGenerator()
|
/cts/tests/tests/keystore/src/android/keystore/cts/util/ |
D | TestUtils.java | 840 public static boolean isHmacAlgorithm(String algorithm) { in isHmacAlgorithm() argument 841 return algorithm.toUpperCase(Locale.US).startsWith("HMAC"); in isHmacAlgorithm() 844 public static String getHmacAlgorithmDigest(String algorithm) { in getHmacAlgorithmDigest() argument 845 String algorithmUpperCase = algorithm.toUpperCase(Locale.US); in getHmacAlgorithmDigest() 969 public static String getSignatureAlgorithmDigest(String algorithm) { in getSignatureAlgorithmDigest() argument 970 String algorithmUpperCase = algorithm.toUpperCase(Locale.US); in getSignatureAlgorithmDigest() 973 throw new IllegalArgumentException("Unsupported algorithm: " + algorithm); in getSignatureAlgorithmDigest() 982 public static String getSignatureAlgorithmPadding(String algorithm) { in getSignatureAlgorithmPadding() argument 983 String algorithmUpperCase = algorithm.toUpperCase(Locale.US); in getSignatureAlgorithmPadding() 991 throw new IllegalArgumentException("Unsupported algorithm: " + algorithm); in getSignatureAlgorithmPadding() [all …]
|
/cts/hostsidetests/appsecurity/res/pkgsigverify/ |
D | README.md | 11 `${version}-with-${signing-algorithm}-${OID-params}-${keysize}-${extra_info}` 16 - signing-algorithm: indicates how the signature was generated
|
/cts/tests/security/src/android/keystore/cts/ |
D | AuthorizationList.java | 176 private Integer algorithm; field in AuthorizationList 244 algorithm = Asn1Utils.getIntegerFromAsn1(value); in AuthorizationList() 374 algorithm = CborUtils.getInt(submodMap, key); in AuthorizationList() 481 public static String algorithmToString(int algorithm) { in algorithmToString() argument 482 switch (algorithm) { in algorithmToString() 574 return algorithm; in getAlgorithm() 796 if (algorithm != null) { in toString() 797 s.append("\nAlgorithm: ").append(algorithmToString(algorithm)); in toString()
|