/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 | 631 for (String algorithm : EXPECTED_SIGNATURE_ALGORITHMS) { in testSmallMsgKat() 633 byte[] goodSigBytes = SHORT_MSG_KAT_SIGNATURES.get(algorithm); in testSmallMsgKat() 635 KeyPair keyPair = importDefaultKatKeyPair(algorithm).getKeystoreBackedKeyPair(); in testSmallMsgKat() 638 algorithm, provider, keyPair.getPublic(), message, goodSigBytes); in testSmallMsgKat() 640 algorithm, provider, keyPair.getPublic(), message, goodSigBytes); in testSmallMsgKat() 642 algorithm, provider, keyPair.getPublic(), message, goodSigBytes, 3); in testSmallMsgKat() 647 algorithm, provider, keyPair.getPublic(), messageWithBitFlip, goodSigBytes); in testSmallMsgKat() 652 algorithm, provider, keyPair.getPublic(), message, goodSigWithBitFlip); in testSmallMsgKat() 655 Signature signature = Signature.getInstance(algorithm, provider); in testSmallMsgKat() 660 algorithm.toLowerCase().endsWith("withrsa"); in testSmallMsgKat() [all …]
|
D | KeyGeneratorTest.java | 113 for (String algorithm : EXPECTED_ALGORITHMS) { in testGenerateWithoutInitThrowsIllegalStateException() 115 KeyGenerator keyGenerator = getKeyGenerator(algorithm); in testGenerateWithoutInitThrowsIllegalStateException() 121 throw new RuntimeException("Failed for " + algorithm, e); in testGenerateWithoutInitThrowsIllegalStateException() 127 for (String algorithm : EXPECTED_ALGORITHMS) { in testInitWithKeySizeThrowsUnsupportedOperationException() 129 KeyGenerator keyGenerator = getKeyGenerator(algorithm); in testInitWithKeySizeThrowsUnsupportedOperationException() 130 int keySizeBits = DEFAULT_KEY_SIZES.get(algorithm); in testInitWithKeySizeThrowsUnsupportedOperationException() 136 throw new RuntimeException("Failed for " + algorithm, e); in testInitWithKeySizeThrowsUnsupportedOperationException() 144 for (String algorithm : EXPECTED_ALGORITHMS) { in testInitWithKeySizeAndSecureRandomThrowsUnsupportedOperationException() 146 KeyGenerator keyGenerator = getKeyGenerator(algorithm); in testInitWithKeySizeAndSecureRandomThrowsUnsupportedOperationException() 147 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 | 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 | 68 AndroidKeystoreRsaKeyGenerator(String algorithm, int keySize, byte[] challenge) in AndroidKeystoreRsaKeyGenerator() argument 70 super(algorithm); in AndroidKeystoreRsaKeyGenerator() 78 TestUtils.getSignatureAlgorithmPadding(algorithm)) in AndroidKeystoreRsaKeyGenerator() 79 .setDigests(TestUtils.getSignatureAlgorithmDigest(algorithm)) in AndroidKeystoreRsaKeyGenerator() 87 AndroidKeystoreEcKeyGenerator(String algorithm, int keySize, byte[] challenge) in AndroidKeystoreEcKeyGenerator() argument 89 super(algorithm); in AndroidKeystoreEcKeyGenerator() 96 .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 | 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 | 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 | DesCipherPerformanceTest.java | 59 private void testDesCipher(String algorithm, int[] keySizes, int[] messageSizes) in testDesCipher() argument 63 new AndroidKeystoreDesKeyGenerator(algorithm, keySize); in testDesCipher() 65 new DefaultKeystoreSecretKeyGenerator(algorithm, keySize); in testDesCipher() 81 AndroidKeystoreDesKeyGenerator(String algorithm, int keySize) throws Exception { in AndroidKeystoreDesKeyGenerator() argument 82 super(algorithm); in AndroidKeystoreDesKeyGenerator() 88 .setBlockModes(TestUtils.getCipherBlockMode(algorithm)) in AndroidKeystoreDesKeyGenerator() 90 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 | 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 | RSASignatureTest.java | 46 for (String algorithm : SignatureTest.EXPECTED_SIGNATURE_ALGORITHMS) { 47 String keyAlgorithm = TestUtils.getSignatureAlgorithmKeyAlgorithm(algorithm); 49 sigAlgs.add(algorithm); 111 for (String algorithm : SIGNATURE_ALGORITHMS) { in testSmallKeyRejected() 113 String digest = TestUtils.getSignatureAlgorithmDigest(algorithm); in testSmallKeyRejected() 129 TestUtils.getMinimalWorkingImportParametersForSigningingWith(algorithm)) in testSmallKeyRejected() 134 Signature signature = Signature.getInstance(algorithm, provider); in testSmallKeyRejected() 146 throw new RuntimeException("Failed for " + algorithm, e); in testSmallKeyRejected()
|
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 | TransparentSecretKey.java | 31 public TransparentSecretKey(byte[] keyMaterial, String algorithm) { in TransparentSecretKey() argument 32 mAlgorithm = algorithm; in TransparentSecretKey()
|
D | DesKeyGenPerformanceTest.java | 40 AndroidKeystoreDesKeyGenerator(String algorithm, int keySize) throws Exception { in AndroidKeystoreDesKeyGenerator() argument 41 super(algorithm); in AndroidKeystoreDesKeyGenerator()
|
D | AesKeyGenPerformanceTest.java | 39 AndroidKeystoreAesKeyGenerator(String algorithm, int keySize) throws Exception { in AndroidKeystoreAesKeyGenerator() argument 40 super(algorithm); in AndroidKeystoreAesKeyGenerator()
|
D | HmacKeyGenPerformanceTest.java | 39 AndroidKeystoreHmacKeyGenerator(String algorithm, int keySize) throws Exception { in AndroidKeystoreHmacKeyGenerator() argument 40 super(algorithm); in AndroidKeystoreHmacKeyGenerator()
|
D | RsaKeyGenPerformanceTest.java | 41 AndroidKeystoreRsaKeyenerator(String algorithm, int keySize) throws Exception { in AndroidKeystoreRsaKeyenerator() argument 42 super(algorithm); in AndroidKeystoreRsaKeyenerator()
|
D | TestUtils.java | 684 static boolean isHmacAlgorithm(String algorithm) { in isHmacAlgorithm() argument 685 return algorithm.toUpperCase(Locale.US).startsWith("HMAC"); in isHmacAlgorithm() 688 static String getHmacAlgorithmDigest(String algorithm) { in getHmacAlgorithmDigest() argument 689 String algorithmUpperCase = algorithm.toUpperCase(Locale.US); in getHmacAlgorithmDigest() 813 static String getSignatureAlgorithmDigest(String algorithm) { in getSignatureAlgorithmDigest() argument 814 String algorithmUpperCase = algorithm.toUpperCase(Locale.US); in getSignatureAlgorithmDigest() 817 throw new IllegalArgumentException("Unsupported algorithm: " + algorithm); in getSignatureAlgorithmDigest() 826 static String getSignatureAlgorithmPadding(String algorithm) { in getSignatureAlgorithmPadding() argument 827 String algorithmUpperCase = algorithm.toUpperCase(Locale.US); in getSignatureAlgorithmPadding() 835 throw new IllegalArgumentException("Unsupported algorithm: " + algorithm); in getSignatureAlgorithmPadding() [all …]
|
D | KeyPairGeneratorTest.java | 219 for (String algorithm : EXPECTED_ALGORITHMS) { in testDefaultKeySize() 221 int expectedSizeBits = DEFAULT_KEY_SIZES.get(algorithm); in testDefaultKeySize() 222 KeyPairGenerator generator = getGenerator(algorithm); in testDefaultKeySize() 228 throw new RuntimeException("Failed for " + algorithm, e); in testDefaultKeySize() 234 for (String algorithm : EXPECTED_ALGORITHMS) { in testInitWithUnknownBlockModeFails() 236 KeyPairGenerator generator = getGenerator(algorithm); in testInitWithUnknownBlockModeFails() 242 throw new RuntimeException("Failed for " + algorithm, e); in testInitWithUnknownBlockModeFails() 248 for (String algorithm : EXPECTED_ALGORITHMS) { in testInitWithUnknownEncryptionPaddingFails() 250 KeyPairGenerator generator = getGenerator(algorithm); in testInitWithUnknownEncryptionPaddingFails() 256 throw new RuntimeException("Failed for " + algorithm, e); in testInitWithUnknownEncryptionPaddingFails() [all …]
|
D | AttestKeyTest.java | 184 private Certificate[] generateKeyPair(String algorithm, KeyGenParameterSpec spec) in generateKeyPair() argument 187 KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(algorithm, in generateKeyPair()
|
/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 | 175 private Integer algorithm; field in AuthorizationList 235 algorithm = Asn1Utils.getIntegerFromAsn1(value); in AuthorizationList() 359 algorithm = CborUtils.getInt(submodMap, key); in AuthorizationList() 463 public static String algorithmToString(int algorithm) { in algorithmToString() argument 464 switch (algorithm) { in algorithmToString() 556 return algorithm; in getAlgorithm() 768 if (algorithm != null) { in toString() 769 s.append("\nAlgorithm: ").append(algorithmToString(algorithm)); in toString()
|