/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 | 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 | KeyGeneratorTest.java | 112 for (String algorithm : EXPECTED_ALGORITHMS) { in testGenerateWithoutInitThrowsIllegalStateException() 114 KeyGenerator keyGenerator = getKeyGenerator(algorithm); in testGenerateWithoutInitThrowsIllegalStateException() 120 throw new RuntimeException("Failed for " + algorithm, e); in testGenerateWithoutInitThrowsIllegalStateException() 126 for (String algorithm : EXPECTED_ALGORITHMS) { in testInitWithKeySizeThrowsUnsupportedOperationException() 128 KeyGenerator keyGenerator = getKeyGenerator(algorithm); in testInitWithKeySizeThrowsUnsupportedOperationException() 129 int keySizeBits = DEFAULT_KEY_SIZES.get(algorithm); in testInitWithKeySizeThrowsUnsupportedOperationException() 135 throw new RuntimeException("Failed for " + algorithm, e); in testInitWithKeySizeThrowsUnsupportedOperationException() 143 for (String algorithm : EXPECTED_ALGORITHMS) { in testInitWithKeySizeAndSecureRandomThrowsUnsupportedOperationException() 145 KeyGenerator keyGenerator = getKeyGenerator(algorithm); in testInitWithKeySizeAndSecureRandomThrowsUnsupportedOperationException() 146 int keySizeBits = DEFAULT_KEY_SIZES.get(algorithm); in testInitWithKeySizeAndSecureRandomThrowsUnsupportedOperationException() [all …]
|
D | SecretKeyFactoryTest.java | 94 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 …]
|
D | CipherTest.java | 336 for (String algorithm : EXPECTED_ALGORITHMS) { in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() 339 algorithm, in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() 345 Cipher cipher = Cipher.getInstance(algorithm, provider); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() 350 cipher = Cipher.getInstance(algorithm); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() 356 cipher = Cipher.getInstance(algorithm); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() 364 throw new RuntimeException("Failed for " + algorithm, e); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() 373 for (String algorithm : EXPECTED_ALGORITHMS) { in testAndroidKeyStorePublicKeysAcceptedByHighestPriorityProviderWhenEncrypting() 374 if (isSymmetric(algorithm)) { in testAndroidKeyStorePublicKeysAcceptedByHighestPriorityProviderWhenEncrypting() 379 algorithm, in testAndroidKeyStorePublicKeysAcceptedByHighestPriorityProviderWhenEncrypting() 383 Cipher cipher = Cipher.getInstance(algorithm); in testAndroidKeyStorePublicKeysAcceptedByHighestPriorityProviderWhenEncrypting() [all …]
|
D | RsaCipherPerformanceTest.java | 50 private void testRsaCipher(String algorithm, int[] keySizes, int[] messageSizes) in testRsaCipher() argument 54 TestUtils.getMaxSupportedPlaintextInputSizeBytes(algorithm, keySize); in testRsaCipher() 61 new AndroidKeystoreRsaKeyGenerator(algorithm, keySize), in testRsaCipher() 65 new AndroidKeystoreRsaKeyGenerator(algorithm, keySize), in testRsaCipher() 69 new DefaultKeystoreKeyPairGenerator(algorithm, keySize), in testRsaCipher() 73 new DefaultKeystoreKeyPairGenerator(algorithm, keySize), in testRsaCipher() 82 AndroidKeystoreRsaKeyGenerator(String algorithm, int keySize) throws Exception { in AndroidKeystoreRsaKeyGenerator() argument 83 super(algorithm); in AndroidKeystoreRsaKeyGenerator() 84 String digest = TestUtils.getCipherDigest(algorithm); in AndroidKeystoreRsaKeyGenerator() 90 .setBlockModes(TestUtils.getCipherBlockMode(algorithm)) in AndroidKeystoreRsaKeyGenerator() [all …]
|
D | AttestationPerformanceTest.java | 60 AndroidKeystoreRsaKeyGenerator(String algorithm, int keySize, byte[] challenge) in AndroidKeystoreRsaKeyGenerator() argument 62 super(algorithm); in AndroidKeystoreRsaKeyGenerator() 70 TestUtils.getSignatureAlgorithmPadding(algorithm)) in AndroidKeystoreRsaKeyGenerator() 71 .setDigests(TestUtils.getSignatureAlgorithmDigest(algorithm)) in AndroidKeystoreRsaKeyGenerator() 79 AndroidKeystoreEcKeyGenerator(String algorithm, int keySize, byte[] challenge) in AndroidKeystoreEcKeyGenerator() argument 81 super(algorithm); in AndroidKeystoreEcKeyGenerator() 88 .setDigests(TestUtils.getSignatureAlgorithmDigest(algorithm)) in AndroidKeystoreEcKeyGenerator()
|
D | EcdsaSignaturePerformanceTest.java | 56 private void testEcdsaSign(String algorithm, int[] messageSizes) throws Exception { in testEcdsaSign() argument 59 new AndroidKeystoreEcKeyGenerator(algorithm, keySize); in testEcdsaSign() 61 new DefaultKeystoreEcKeyGenerator(algorithm, keySize); in testEcdsaSign() 78 DefaultKeystoreEcKeyGenerator(String algorithm, int keySize) throws Exception { in DefaultKeystoreEcKeyGenerator() argument 79 super(algorithm); in DefaultKeystoreEcKeyGenerator() 86 AndroidKeystoreEcKeyGenerator(String algorithm, int keySize) throws Exception { in AndroidKeystoreEcKeyGenerator() argument 87 super(algorithm); in AndroidKeystoreEcKeyGenerator() 94 .setDigests(TestUtils.getSignatureAlgorithmDigest(algorithm)) in AndroidKeystoreEcKeyGenerator()
|
D | DesCipherPerformanceTest.java | 49 private void testDesCipher(String algorithm, int[] keySizes, int[] messageSizes) in testDesCipher() argument 53 new AndroidKeystoreDesKeyGenerator(algorithm, keySize); in testDesCipher() 55 new DefaultKeystoreSecretKeyGenerator(algorithm, keySize); in testDesCipher() 71 AndroidKeystoreDesKeyGenerator(String algorithm, int keySize) throws Exception { in AndroidKeystoreDesKeyGenerator() argument 72 super(algorithm); in AndroidKeystoreDesKeyGenerator() 78 .setBlockModes(TestUtils.getCipherBlockMode(algorithm)) in AndroidKeystoreDesKeyGenerator() 80 TestUtils.getCipherEncryptionPadding(algorithm)) in AndroidKeystoreDesKeyGenerator()
|
D | RsaSignaturePerformanceTest.java | 85 private void testRsaSign(String algorithm, int[] keySizes, int[] messageSizes) in testRsaSign() argument 88 if (!TestUtils.isKeyLongEnoughForSignatureAlgorithm(algorithm, keySize)) { in testRsaSign() 92 new AndroidKeystoreRsaKeyGenerator(algorithm, keySize); in testRsaSign() 94 new DefaultKeystoreKeyPairGenerator(algorithm, keySize); in testRsaSign() 111 AndroidKeystoreRsaKeyGenerator(String algorithm, int keySize) throws Exception { in AndroidKeystoreRsaKeyGenerator() argument 112 super(algorithm); in AndroidKeystoreRsaKeyGenerator() 120 TestUtils.getSignatureAlgorithmPadding(algorithm)) in AndroidKeystoreRsaKeyGenerator() 121 .setDigests(TestUtils.getSignatureAlgorithmDigest(algorithm)) in AndroidKeystoreRsaKeyGenerator()
|
D | AesCipherPerformanceTest.java | 57 private void testAesCipher(String algorithm, int[] keySizes, int[] messageSizes) in testAesCipher() argument 61 new AndroidKeystoreAesKeyGenerator(algorithm, keySize); in testAesCipher() 63 new DefaultKeystoreSecretKeyGenerator(algorithm, keySize); in testAesCipher() 79 AndroidKeystoreAesKeyGenerator(String algorithm, int keySize) throws Exception { in AndroidKeystoreAesKeyGenerator() argument 80 super(algorithm); in AndroidKeystoreAesKeyGenerator() 86 .setBlockModes(TestUtils.getCipherBlockMode(algorithm)) in AndroidKeystoreAesKeyGenerator() 88 TestUtils.getCipherEncryptionPadding(algorithm)) in AndroidKeystoreAesKeyGenerator()
|
D | PerformanceTestBase.java | 280 KeystoreKeyGenerator(String algorithm, String provider) throws Exception { in KeystoreKeyGenerator() argument 281 mAlgorithm = algorithm; in KeystoreKeyGenerator() 285 KeystoreKeyGenerator(String algorithm) throws Exception { in KeystoreKeyGenerator() argument 287 this(algorithm, KeyGenerator.getInstance("AES").getProvider().getName()); in KeystoreKeyGenerator() 328 AndroidKeystoreKeyGenerator(String algorithm) throws Exception { in AndroidKeystoreKeyGenerator() argument 329 super(algorithm, TestUtils.EXPECTED_PROVIDER_NAME); in AndroidKeystoreKeyGenerator() 350 DefaultKeystoreKeyPairGenerator(String algorithm, int keySize) throws Exception { in DefaultKeystoreKeyPairGenerator() argument 351 super(algorithm); in DefaultKeystoreKeyPairGenerator() 358 DefaultKeystoreSecretKeyGenerator(String algorithm, int keySize) throws Exception { in DefaultKeystoreSecretKeyGenerator() argument 359 super(algorithm); in DefaultKeystoreSecretKeyGenerator()
|
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 | HmacMacPerformanceTest.java | 51 private void testHmac(String algorithm, int[] keySizes, int[] messageSizes) throws Exception { in testHmac() argument 54 new AndroidKeystoreHmacKeyGenerator(algorithm, keySize); in testHmac() 56 new DefaultKeystoreSecretKeyGenerator(algorithm, keySize); in testHmac() 69 AndroidKeystoreHmacKeyGenerator(String algorithm, int keySize) throws Exception { in AndroidKeystoreHmacKeyGenerator() argument 70 super(algorithm); in AndroidKeystoreHmacKeyGenerator()
|
D | EcKeyGenPerformanceTest.java | 41 AndroidKeystoreEcKeyGenerator(String algorithm, int keySize) throws Exception { in AndroidKeystoreEcKeyGenerator() argument 42 super(algorithm); in AndroidKeystoreEcKeyGenerator() 55 DefaultKeystoreEcKeyGenerator(String algorithm, int curve) throws Exception { in DefaultKeystoreEcKeyGenerator() argument 56 super(algorithm); in DefaultKeystoreEcKeyGenerator()
|
D | TestUtils.java | 627 static boolean isHmacAlgorithm(String algorithm) { in isHmacAlgorithm() argument 628 return algorithm.toUpperCase(Locale.US).startsWith("HMAC"); in isHmacAlgorithm() 631 static String getHmacAlgorithmDigest(String algorithm) { in getHmacAlgorithmDigest() argument 632 String algorithmUpperCase = algorithm.toUpperCase(Locale.US); in getHmacAlgorithmDigest() 756 static String getSignatureAlgorithmDigest(String algorithm) { in getSignatureAlgorithmDigest() argument 757 String algorithmUpperCase = algorithm.toUpperCase(Locale.US); in getSignatureAlgorithmDigest() 760 throw new IllegalArgumentException("Unsupported algorithm: " + algorithm); in getSignatureAlgorithmDigest() 769 static String getSignatureAlgorithmPadding(String algorithm) { in getSignatureAlgorithmPadding() argument 770 String algorithmUpperCase = algorithm.toUpperCase(Locale.US); in getSignatureAlgorithmPadding() 778 throw new IllegalArgumentException("Unsupported algorithm: " + algorithm); in getSignatureAlgorithmPadding() [all …]
|
D | TransparentSecretKey.java | 31 public TransparentSecretKey(byte[] keyMaterial, String algorithm) { in TransparentSecretKey() argument 32 mAlgorithm = algorithm; in TransparentSecretKey()
|
D | KeyPairGeneratorTest.java | 216 for (String algorithm : EXPECTED_ALGORITHMS) { in testDefaultKeySize() 218 int expectedSizeBits = DEFAULT_KEY_SIZES.get(algorithm); in testDefaultKeySize() 219 KeyPairGenerator generator = getGenerator(algorithm); in testDefaultKeySize() 225 throw new RuntimeException("Failed for " + algorithm, e); in testDefaultKeySize() 231 for (String algorithm : EXPECTED_ALGORITHMS) { in testInitWithUnknownBlockModeFails() 233 KeyPairGenerator generator = getGenerator(algorithm); in testInitWithUnknownBlockModeFails() 239 throw new RuntimeException("Failed for " + algorithm, e); in testInitWithUnknownBlockModeFails() 245 for (String algorithm : EXPECTED_ALGORITHMS) { in testInitWithUnknownEncryptionPaddingFails() 247 KeyPairGenerator generator = getGenerator(algorithm); in testInitWithUnknownEncryptionPaddingFails() 253 throw new RuntimeException("Failed for " + algorithm, e); in testInitWithUnknownEncryptionPaddingFails() [all …]
|
D | DesKeyGenPerformanceTest.java | 39 AndroidKeystoreDesKeyGenerator(String algorithm, int keySize) throws Exception { in AndroidKeystoreDesKeyGenerator() argument 40 super(algorithm); in AndroidKeystoreDesKeyGenerator()
|
D | AesKeyGenPerformanceTest.java | 39 AndroidKeystoreAesKeyGenerator(String algorithm, int keySize) throws Exception { in AndroidKeystoreAesKeyGenerator() argument 40 super(algorithm); in AndroidKeystoreAesKeyGenerator()
|
D | RsaKeyGenPerformanceTest.java | 41 AndroidKeystoreRsaKeyenerator(String algorithm, int keySize) throws Exception { in AndroidKeystoreRsaKeyenerator() argument 42 super(algorithm); in AndroidKeystoreRsaKeyenerator()
|
D | HmacKeyGenPerformanceTest.java | 39 AndroidKeystoreHmacKeyGenerator(String algorithm, int keySize) throws Exception { in AndroidKeystoreHmacKeyGenerator() argument 40 super(algorithm); in AndroidKeystoreHmacKeyGenerator()
|
/cts/tests/security/src/android/keystore/cts/ |
D | AuthorizationList.java | 170 private Integer algorithm; field in AuthorizationList 226 algorithm = Asn1Utils.getIntegerFromAsn1(value); in AuthorizationList() 334 public static String algorithmToString(int algorithm) { in algorithmToString() argument 335 switch (algorithm) { in algorithmToString() 423 return algorithm; in getAlgorithm() 622 if (algorithm != null) { in toString() 623 s.append("\nAlgorithm: ").append(algorithmToString(algorithm)); in toString()
|
/cts/hostsidetests/appsecurity/res/pkgsigverify/ |
D | README.txt | 7 ${version}-with-${signing-algorithm}-${OID-params}-${keysize}-${extra_info} 12 signing-algorithm: indicates how the signature was generated
|