Skip to content

Commit

Permalink
refactor: Bug fix for ebsiV3 card issuance
Browse files Browse the repository at this point in the history
  • Loading branch information
bibash28 committed Aug 23, 2023
1 parent a1e967a commit eeb0517
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/oidc4vc/add_oidc4vc_credential.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,22 @@ Future<void> addOIDC4VCCredential({
required dynamic encodedCredentialFromOIDC4VC,
required Uri uri,
required CredentialsCubit credentialsCubit,
required OIDC4VCType oidc4vcType,
required String issuer,
required OIDC4VCType oidc4vcType,
required String credentialType,
required bool isLastCall,
required String format,
}) async {
late Map<String, dynamic> credentialFromOIDC4VC;
if (oidc4vcType.issuerVcType == 'jwt_vc') {
if (format == 'jwt_vc') {
//jwt_vc_json
final jws = JsonWebSignature.fromCompactSerialization(
encodedCredentialFromOIDC4VC['credential'] as String,
);

credentialFromOIDC4VC =
jws.unverifiedPayload.jsonContent['vc'] as Map<String, dynamic>;
} else if (oidc4vcType.issuerVcType == 'ldp_vc') {
} else if (format == 'ldp_vc') {
//ldp_vc

final data = encodedCredentialFromOIDC4VC['credential'];
Expand All @@ -42,7 +43,7 @@ Future<void> addOIDC4VCCredential({
final Map<String, dynamic> newCredential =
Map<String, dynamic>.from(credentialFromOIDC4VC);

if (oidc4vcType.issuerVcType == 'jwt_vc') {
if (format == 'jwt_vc') {
//jwt_vc_json
newCredential['jwt'] = encodedCredentialFromOIDC4VC['credential'];
}
Expand Down
1 change: 1 addition & 0 deletions lib/oidc4vc/initiate_oidv4vc_credential_issuance.dart
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ Future<void> getAndAddCredential({
issuer: issuer,
credentialType: credentialType,
isLastCall: isLastCall,
format: format,
);
} else {
final Uri ebsiAuthenticationUri =
Expand Down

0 comments on commit eeb0517

Please sign in to comment.