Skip to content

Commit

Permalink
Update jose package and solve jwt verification #2530
Browse files Browse the repository at this point in the history
  • Loading branch information
bibash28 committed Mar 22, 2024
1 parent e4a3cb9 commit f569584
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ class CredentialDetailsCubit extends Cubit<CredentialDetailsState> {
emit(state.copyWith(status: AppStatus.loading));
await Future<void>.delayed(const Duration(milliseconds: 500));

// if (!profileCubit.state.model.profileSetting.selfSovereignIdentityOptions
// .customOidc4vcProfile.securityLevel) {
// emit(
// state.copyWith(
// credentialStatus: CredentialStatus.notVerified,
// status: AppStatus.idle,
// ),
// );
// return;
// }
if (!profileCubit.state.model.profileSetting.selfSovereignIdentityOptions
.customOidc4vcProfile.securityLevel) {
emit(
state.copyWith(
credentialStatus: CredentialStatus.notVerified,
status: AppStatus.idle,
),
);
return;
}

if (item.credentialPreview.credentialSubjectModel.credentialSubjectType ==
CredentialSubjectType.walletCredential) {
Expand Down
9 changes: 8 additions & 1 deletion lib/oidc4vc/verify_encoded_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@ Future<VerificationType> verifyEncodedData(
String jwt,
) async {
final OIDC4VC oidc4vc = OIDC4VC();

var updateJwt = jwt;

if (updateJwt.contains('~')) {
updateJwt = jwt.split('~').first;
}

final VerificationType verificationType = await oidc4vc.verifyEncodedData(
issuerDid: issuerDid,
jwt: jwt,
jwt: updateJwt,
issuerKid: issuerKid,
);
return verificationType;
Expand Down
2 changes: 1 addition & 1 deletion packages/oidc4vc/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dependencies:
sdk: flutter
hex: ^0.2.0
http_mock_adapter: ^0.6.0
jose_plus: ^0.4.4
jose_plus: ^0.4.5
json_annotation: ^4.8.1
json_path: ^0.4.4 #latest version creates test issue
secp256k1: ^0.3.0
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ dependencies:
google_mlkit_barcode_scanning: ^0.10.0
image: ^4.0.17
image_picker: ^1.0.7
jose_plus: ^0.4.4
jose_plus: ^0.4.5
json_annotation: ^4.8.1
json_path: ^0.4.4 #latest version creates test issue
jwt_decode:
Expand Down

0 comments on commit f569584

Please sign in to comment.