-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
301 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
148 changes: 0 additions & 148 deletions
148
lib/dashboard/home/tab_bar/credentials/detail/widgets/claims_data.dart
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
lib/dashboard/home/tab_bar/credentials/detail/widgets/widgets.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import 'dart:convert'; | ||
|
||
import 'package:altme/dashboard/home/tab_bar/credentials/models/credential_model/credential_model.dart'; | ||
|
||
class SelectiveDisclosure { | ||
SelectiveDisclosure(this.credentialModel); | ||
final CredentialModel credentialModel; | ||
|
||
Map<String, dynamic> get claims { | ||
final credentialSupported = credentialModel.credentialSupported; | ||
|
||
final claims = credentialSupported!['claims']; | ||
|
||
if (claims is! Map<String, dynamic>) { | ||
return <String, dynamic>{}; | ||
} | ||
|
||
return claims; | ||
} | ||
|
||
Map<String, dynamic> get values { | ||
final encryptedValues = credentialModel.jwt?.split('~'); | ||
final extractedValues = <String, dynamic>{}; | ||
if (encryptedValues != null) { | ||
encryptedValues.removeAt(0); | ||
|
||
for (var element in encryptedValues) { | ||
try { | ||
while (element.length % 4 != 0) { | ||
element += '='; | ||
} | ||
|
||
final decryptedData = utf8.decode(base64Decode(element)); | ||
|
||
if (decryptedData.isNotEmpty) { | ||
final lisString = jsonDecode(decryptedData); | ||
if (lisString is List) { | ||
if (lisString.length == 3) { | ||
extractedValues[lisString[1].toString()] = lisString[2]; | ||
} | ||
} | ||
} | ||
} catch (e) { | ||
// | ||
} | ||
} | ||
} | ||
return extractedValues; | ||
|
||
} | ||
} |
Oops, something went wrong.