improvement(Passkey): Accept decimal values of cred params algorithm and round it to an int
This commit is contained in:
parent
7cd468542e
commit
601984ac28
|
@ -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 {
|
||||
|
|
|
@ -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,
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue