mirror of
https://github.com/xtool-org/xtool.git
synced 2026-11-20 18:38:03 +03:00
Fix cert serial number encoding
This commit is contained in:
@@ -51,7 +51,7 @@ public struct Certificate: Codable, Sendable {
|
|||||||
public func serialNumber() -> String {
|
public func serialNumber() -> String {
|
||||||
// big endian, hex-encoded
|
// big endian, hex-encoded
|
||||||
let content = raw.serialNumber.bytes.lazy
|
let content = raw.serialNumber.bytes.lazy
|
||||||
.map { String($0, radix: 16, uppercase: true) }
|
.map { String(format: "%02hhX", $0) }
|
||||||
.joined()
|
.joined()
|
||||||
.drop { $0 == "0" }
|
.drop { $0 == "0" }
|
||||||
return String(content)
|
return String(content)
|
||||||
|
|||||||
Reference in New Issue
Block a user