타원 곡선 개인 키를 생성하려고하지만 Android OS 버전 5 및 6에서이 오류가 계속 발생합니다. 다음은 EC 암호화로 PrivateKey를 생성하는 코드입니다 . 여기 Android : InvalidKeySpecException : 타원 곡선 루틴 : EC_GROUP_new_by_curve_name : UNKNOWN_GROUP
private static java.security.PrivateKey createPrivateKey(List<PrivateKey> privateKeys, String appInstallationIdentifier) throws Exception {
PrivateKey privateKey = getPrivateKeyForActivation(privateKeys);
String key = decryptMessage(privateKey.getEncryptedPrivateKey(), appInstallationIdentifier, privateKey.getIv());
key = key.replace("-----BEGIN PRIVATE KEY-----", "")
.replace("-----END PRIVATE KEY-----", "")
.replaceAll("\\s", "");
byte[] privateKeyFileContent = decode(key);
KeyFactory keyFactory = KeyFactory.getInstance("EC");
PKCS8EncodedKeySpec ks = new PKCS8EncodedKeySpec(privateKeyFileContent);
return keyFactory.generatePrivate(ks);
}
그리고
내가이 오류가 왜 어떤 아이디어 OS 버전 5에 받고 6java.security.spec.InvalidKeySpecException: java.lang.RuntimeException: error:0f06707b:elliptic curve routines:EC_GROUP_new_by_curve_name:UNKNOWN_GROUP
오류입니까? 또한 EC는 API 레벨 11 이상에서 지원되므로 EC를 사용하면 문제가되지 않습니다.