Skip to content

Commit

Permalink
fix: Update private key use #2630
Browse files Browse the repository at this point in the history
  • Loading branch information
bibash28 committed Apr 30, 2024
1 parent bb9c045 commit 828f1f1
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions lib/app/shared/helper_functions/helper_functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,16 @@ Future<String> getPrivateKey({
required ProfileCubit profileCubit,
required DidKeyType didKeyType,
}) async {
final customOidc4vcProfile = profileCubit.state.model.profileSetting
.selfSovereignIdentityOptions.customOidc4vcProfile;

if (customOidc4vcProfile.clientType == ClientType.p256JWKThumprint) {
final privateKey =
await getP256KeyToGetAndPresentVC(profileCubit.secureStorageProvider);

return privateKey;
}

final mnemonic = await profileCubit.secureStorageProvider
.get(SecureStorageKeys.ssiMnemonic);

Expand Down Expand Up @@ -1579,8 +1589,11 @@ Future<(String?, String?, String?, String?)> getClientDetails({

final didKeyType = customOidc4vcProfile.defaultDid;

final privateKey =
await getP256KeyToGetAndPresentVC(profileCubit.secureStorageProvider);
final String privateKey = await fetchPrivateKey(
profileCubit: profileCubit,
isEBSIV3: isEBSIV3,
didKeyType: didKeyType,
);

final (did, _) = await fetchDidAndKid(
privateKey: privateKey,
Expand All @@ -1594,7 +1607,7 @@ Future<(String?, String?, String?, String?)> getClientDetails({
did: '', // just added as it is required field
mediaType: MediaType.basic, // just added as it is required field
clientType:
ClientType.p256JWKThumprint, // just added as it is required field
customOidc4vcProfile.clientType, // just added as it is required field
proofHeaderType: customOidc4vcProfile.proofHeader,
clientId: '', // just added as it is required field
);
Expand Down

0 comments on commit 828f1f1

Please sign in to comment.