diff --git a/common/src/androidMain/kotlin/com/artemchep/keyguard/android/PasskeyGenerator.kt b/common/src/androidMain/kotlin/com/artemchep/keyguard/android/PasskeyGenerator.kt index 8f54f65a..ac8aac62 100644 --- a/common/src/androidMain/kotlin/com/artemchep/keyguard/android/PasskeyGenerator.kt +++ b/common/src/androidMain/kotlin/com/artemchep/keyguard/android/PasskeyGenerator.kt @@ -6,6 +6,7 @@ import java.security.KeyPairGenerator import java.security.PrivateKey import java.security.Signature import java.security.spec.ECGenParameterSpec +import kotlin.math.roundToInt abstract class PasskeyGeneratorBase : PasskeyGenerator { // https://www.iana.org/assignments/cose/cose.xhtml#algorithms @@ -17,7 +18,7 @@ abstract class PasskeyGeneratorBase : PasskeyGenerator { */ override fun handles( params: CreatePasskeyPubKeyCredParams, - ): Boolean = params.alg == type + ): Boolean = params.alg.roundToInt() == type } interface PasskeyGenerator { diff --git a/common/src/commonMain/kotlin/com/artemchep/keyguard/common/service/passkey/entity/CreatePasskeyRequest.kt b/common/src/commonMain/kotlin/com/artemchep/keyguard/common/service/passkey/entity/CreatePasskeyRequest.kt index e8565006..56711b6c 100644 --- a/common/src/commonMain/kotlin/com/artemchep/keyguard/common/service/passkey/entity/CreatePasskeyRequest.kt +++ b/common/src/commonMain/kotlin/com/artemchep/keyguard/common/service/passkey/entity/CreatePasskeyRequest.kt @@ -73,7 +73,7 @@ data class CreatePasskeyUser( @Serializable data class CreatePasskeyPubKeyCredParams( // https://www.iana.org/assignments/cose/cose.xhtml#algorithms - val alg: Int, + val alg: Double, val type: String, )