相关疑难解决方法(0)

在 API 28(Android Pie) 上支持 Android StrongBox 的 Android 智能手机列表

我需要在 Android 9 中支持安全元素和 StrongBox 的 Android 手机列表。我在哪里或如何找到它?

我用三星 Galaxy S9 和 AVD Google Pixle XL API 28 尝试了下面的代码

KeyPairGenerator kpg = null;
kpg = KeyPairGenerator.getInstance(
KeyProperties.KEY_ALGORITHM_RSA, "AndroidKeyStore");
kpg.initialize(new KeyGenParameterSpec.Builder("keystore1", KeyProperties.PURPOSE_SIGN)
                    .setCertificateSerialNumber(BigInteger.valueOf(1L))
                    .setCertificateSubject(new X500Principal("CN=MyCompany"))
                    .setIsStrongBoxBacked(true) /* Enable StrongBox */
                    .setInvalidatedByBiometricEnrollment(true)
                    .build());
            KeyPair kp = kpg.generateKeyPair();
            KeyFactory factory = KeyFactory.getInstance(KeyProperties.KEY_ALGORITHM_EC, "AndroidKeyStore");
KeyInfo keyInfo = factory.getKeySpec(kp.getPrivate(), KeyInfo.class);
keyInfo.isInsideSecureHardware();
Run Code Online (Sandbox Code Playgroud)

它抛出以下异常:

android.security.keystore.StrongBoxUnavailableException:无法生成密钥对

security android keystore secure-element

5
推荐指数
2
解决办法
2235
查看次数

标签 统计

android ×1

keystore ×1

secure-element ×1

security ×1