【发布时间】:2019-09-21 10:03:59
【问题描述】:
我在这篇文章中读到:Generate elliptic curve KeyPair via KeyStore on API Level <23 有可能在 Android 5 上使用椭圆曲线。据此:
在 API 级别 23 之前,可以使用算法“RSA”的 KeyPairGenerator 生成 EC 密钥,该算法初始化 KeyPairGeneratorSpec,其密钥类型使用 setKeyType(String) 设置为“EC”。使用此方法无法指定 EC 曲线名称 - NIST P 曲线会根据请求的密钥大小自动选择。
我可以使用RSA,然后将密钥类型设置为EC。这两种方法有什么区别吗?当我使用 RSA 和 EC 作为密钥类型和 EC 时,最终会不会一样?
【问题讨论】:
-
KeyPairGenerator.getInstance( KeyProperties.KEY_ALGORITHM_EC)与KeyPairGenerator.getInstance( KeyProperties.KEY_ALGORITHM_RSA)与setKeyType("EC")
标签: android cryptography android-keystore elliptic-curve