Verify a W3C VC
Verify a W3C Verifiable Credential with SpruceKit Mobile SDK
1. Verify an embedded credential
import SwiftUI
import SpruceIDMobileSdkRs
// Here is an example View to scan and try verify a W3C VC JWT VP
struct VerifyVCView: View {
@State var success: Bool?
@Binding var path: NavigationPath
var body: some View {
if success == nil {
// Engage the SpruceKit Mobile SDK ScanningComponent
QRCodeScanner(
title: "Scan QR Code",
subtitle: "Looking...",
onRead: onRead: { code in
Task {
do {
try await verifyJwtVp(jwtVp: code)
success = true
} catch {
success = false
print(error)
}
}
},
onCancel: onCancel,
// example font values
titleFont: .customFont(font: .inter, style: .bold, size: .h0),
subtitleFont: .customFont(font: .inter, style: .bold, size: .h4),
cancelButtonFont: .customFont(font: .inter, style: .medium, size: .h3),
readerColor: .white
)
)
} else {
// Plug in your Verifier results view
}
}
}Verify VCs
2. Delegated Verifier
Last updated
Was this helpful?