50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
+
+
-
+
+
+
|
set cert [::pki::x509::parse_cert $cert]
}]} {
return ""
}
set e [format %llx [dict get $cert e]]
set n [format %llx [dict get $cert n]]
# Pad to even size for hex width
if {[string length $e] % 2 != 0} {
set e "0$e"
}
if {[string length $n] % 2 != 0} {
set n "0$n"
}
if {[string length $n] % 4 == 0} {
# Add a leading zero if the value is high enough
if {"0x[string range $n 0 1]" > 0x7f} {
set n "00$n"
}
set retval "\{
\"publicKey\": \{
\"type\":\"[string toupper [dict get $cert type]]\",
\"e\":\"$e\",
|