Skip to content

Commit

Permalink
Add base64 encodement of x y values of ephemeral key response
Browse files Browse the repository at this point in the history
  • Loading branch information
Jdu278 committed Aug 22, 2024
1 parent c97c188 commit b9665d8
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import org.springframework.web.reactive.function.server.awaitBody
import software.tice.ChallengeRequestData
import software.tice.ZKPVerifier
import java.security.interfaces.ECPrivateKey
import java.util.*
import java.util.concurrent.ConcurrentHashMap

sealed interface ZkpJwkError {
Expand Down Expand Up @@ -82,13 +83,16 @@ class PostZkpJwkRequestLive(
val x = challenge.w.affineX.toString()
val y = challenge.w.affineY.toString()

val base64EncodedX = Base64.getUrlEncoder().encodeToString(x.toByteArray())
val base64EncodedY = Base64.getUrlEncoder().encodeToString(y.toByteArray())

EphemeralKeyResponse(
id = challengeRequest.id,
kid = challengeRequest.id,
kty = "EC",
crv = "P-256",
x = x,
y = y,
x = base64EncodedX,
y = base64EncodedY,
)
}

Expand Down

0 comments on commit b9665d8

Please sign in to comment.