Skip to content

Commit

Permalink
Turn back descriptor.format check and add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jdu278 committed Aug 23, 2024
1 parent d71ed92 commit 3cfaa73
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,17 +179,19 @@ class PostWalletResponseLive(
WalletResponseValidationError.MissingVpTokenOrPresentationSubmission
}

when {
descriptor.format.contains("vc+sd-jwt") -> {
when (descriptor.format) {
"vc+sd-jwt" -> {
checkSdJwtSignature(token)
logger.info("Successfully verified the sdjwt")
}

descriptor.format.contains("mso_mdoc") -> print("mso_mdoc")
descriptor.format.contains("vc+sd-jwt+zkp") -> {
"mso_mdoc" -> print("mso_mdoc")
"vc+sd-jwt+zkp" -> {
logger.info("Starting zkp verification for SDJWT")
val descriptorId: String = descriptor.id.toString()
logger.info("ZKP-SDJWT: descriptorId=$descriptorId")
val key = presentation.zkpKeys?.get(descriptorId)
logger.info("ZKP-SDJWT: key=$key")
ensureNotNull(key) { raise(WalletResponseValidationError.InvalidVPToken) }

val proofed = token.let {
Expand All @@ -201,7 +203,7 @@ class PostWalletResponseLive(
logger.info("Proofed SD-JWT with ZK")
}

descriptor.format.contains("mso_mdoc+zkp") -> {
"mso_mdoc+zkp" -> {
logger.info("Starting zkp verification for mDoc")
}

Expand Down

0 comments on commit 3cfaa73

Please sign in to comment.