Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
serial number in hex string
Browse files Browse the repository at this point in the history
  • Loading branch information
darkdh committed Jul 15, 2016
1 parent 6761701 commit 1d3764e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion js/about/certerror.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ function toByteArray (str) {
return bytes
}

function seperateHex (hexStr) {
var result = []
for (var i = 0; i < hexStr.length; ++i) {
result += hexStr[i]
if (i % 2 && i != hexStr.length - 1) {
result += ':'
}
}
return result
}

class CertErrorPage extends React.Component {
constructor () {
super()
Expand All @@ -50,7 +61,7 @@ class CertErrorPage extends React.Component {
certDetail: true,
certIssuerName: detail.issuerName,
certSubjectName: detail.subjectName,
certSerialNumber: toHexString(toByteArray(detail.serialNumber)),
certSerialNumber: seperateHex(detail.serialNumber),
certValidStart: validStart.toString(),
certValidExpiry: validExpiry.toString(),
certFingerprint: detail.fingerprint.split('/')
Expand Down

0 comments on commit 1d3764e

Please sign in to comment.