mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 09:47:37 +00:00
format sha1 string
This commit is contained in:
parent
f17785ffc7
commit
a8c3d5f104
1 changed files with 11 additions and 1 deletions
|
@ -84,13 +84,23 @@ Future<bool> showBadX509CertificateDialog(
|
||||||
int port,
|
int port,
|
||||||
BuildContext context,
|
BuildContext context,
|
||||||
) async {
|
) async {
|
||||||
|
final chars = Format.uint8listToString(cert.sha1)
|
||||||
|
.toUpperCase()
|
||||||
|
.characters
|
||||||
|
.toList(growable: false);
|
||||||
|
|
||||||
|
String sha1 = chars.sublist(0, 2).join();
|
||||||
|
for (int i = 2; i < chars.length; i += 2) {
|
||||||
|
sha1 += ":${chars.sublist(i, i + 2).join()}";
|
||||||
|
}
|
||||||
|
|
||||||
final result = await showDialog<bool>(
|
final result = await showDialog<bool>(
|
||||||
context: context,
|
context: context,
|
||||||
barrierDismissible: false,
|
barrierDismissible: false,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return StackDialog(
|
return StackDialog(
|
||||||
title: "Untrusted X509Certificate",
|
title: "Untrusted X509Certificate",
|
||||||
message: "SHA1: ${Format.uint8listToString(cert.sha1)}",
|
message: "SHA1:\n$sha1",
|
||||||
leftButton: SecondaryButton(
|
leftButton: SecondaryButton(
|
||||||
label: "Cancel",
|
label: "Cancel",
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
|
Loading…
Reference in a new issue