Skip to content

Commit

Permalink
delete only the active uri from secure storage entries
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkbee1 committed May 17, 2024
1 parent 77a3a5f commit 525c8af
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions packages/oidc4vc/lib/src/oidc4vc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1723,7 +1723,7 @@ class OIDC4VC {
// TODO(hawkbee): To be removed.
/// temporary solution to purge faulty stored data
/// Will be removed in the future
await purgeFaultyStorageEntries(secureStorageProvider, uri);
await secureStorageProvider.delete(uri);

/// end of temporary solution
dynamic response;
Expand Down Expand Up @@ -1765,20 +1765,6 @@ class OIDC4VC {
}
}

// TODO(hawkbee): To be removed.
Future<void> purgeFaultyStorageEntries(
SecureStorageProvider secureStorageProvider, String uri) async {
// get all entries from the storage
final entries = await secureStorageProvider.getAllValues();
// remove all entries that do not start with the https://
for (final entry in entries.entries) {
if (!entry.key.startsWith('https://')) {
await secureStorageProvider.delete(entry.key);
print(entry.key + ' deleted');
}
}
}

Map<String, dynamic> publicKeyBase58ToPublicJwk(String publicKeyBase58) {
///step 1 : change the publicKeyBase58 format from base58 to base64 :
///decode base58 then encode in base64 urlsafe
Expand Down

0 comments on commit 525c8af

Please sign in to comment.