fix(certgen): accept ECDSA as EC algorithm alias in JCA key type matching

Some Android 10 devices (e.g. Sony H8296) report EC private key
algorithm as "ECDSA" instead of "EC", causing IllegalArgumentException
in certificate signing and a SIGSEGV crash in the keystore process.

Closes #4
This commit is contained in:
Enginex0
2026-03-17 19:48:19 +01:00
parent 36ccd22cdc
commit eddd9908af
2 changed files with 2 additions and 2 deletions
@@ -240,7 +240,7 @@ object CertificateGenerator {
val signerAlgorithm =
when (signingKeyPair.private.algorithm) {
"EC" -> "SHA256withECDSA"
"EC", "ECDSA" -> "SHA256withECDSA"
"RSA" -> "SHA256withRSA"
else -> throw IllegalArgumentException("Unsupported signing key: ${signingKeyPair.private.algorithm}")
}
@@ -105,7 +105,7 @@ object NativeCertGen {
}
val algorithmName = when (certs[0].publicKey.algorithm) {
"EC" -> "EC"
"EC", "ECDSA" -> "EC"
"RSA" -> "RSA"
else -> certs[0].publicKey.algorithm
}