Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions app/src/main/java/com/credman/cmwallet/openid4vci/OpenId4VCI.kt
Original file line number Diff line number Diff line change
Expand Up @@ -452,13 +452,17 @@ class OpenId4VCI(val credentialOfferJson: String) {

suspend fun createKeyProofs(credentialConfigurationId: String): ProofCreationResult {
val proofTypesSupported = credentialOffer.issuerMetadata.credentialConfigurationsSupported[credentialConfigurationId]?.proofTypesSupported!!
return if (proofTypesSupported.containsKey("android_keystore_attestation")) {
createAndroidAttestationProofJwt()
} else if (proofTypesSupported.containsKey("jwt")) {
createProofJwt()
} else {
throw UnsupportedOperationException("Can handle proof types $proofTypesSupported")
if (proofTypesSupported.containsKey("android_keystore_attestation")) {
try {
return createAndroidAttestationProofJwt()
} catch (e: Exception) {
Log.w(TAG, "Failed to create Android KeyStore attestation proof", e)
}
}
if (proofTypesSupported.containsKey("jwt")) {
return createProofJwt()
}
throw UnsupportedOperationException("Could not create key proof. Cannot handle proof types $proofTypesSupported")
}

private suspend fun createAndroidAttestationProofJwt(): ProofCreationResult {
Expand Down
Loading