summaryrefslogtreecommitdiff
path: root/bin-src
diff options
context:
space:
mode:
Diffstat (limited to 'bin-src')
-rw-r--r--bin-src/crtsh-pem2html.go12
-rw-r--r--bin-src/util/oid.go10
2 files changed, 22 insertions, 0 deletions
diff --git a/bin-src/crtsh-pem2html.go b/bin-src/crtsh-pem2html.go
index 109917c..c0b815c 100644
--- a/bin-src/crtsh-pem2html.go
+++ b/bin-src/crtsh-pem2html.go
@@ -28,10 +28,20 @@ func handleBool(ok bool, str string, a ...interface{}) {
}
}
+func rfc6962type(certX509 *x509.Certificate) string {
+ for _, ext := range certX509.Extensions {
+ if ext.Id.Equal(util.OID_RFC6962_Poison) {
+ return "Precertificate"
+ }
+ }
+ return "Certificate"
+}
+
var tmpl = template.Must(template.New("pem2html").
Funcs(template.FuncMap{
"red": red,
"green": green,
+ "rfc6962type": rfc6962type,
"date": util.Date2HTML,
"datetime": util.DateTime2HTML,
"colorDatetime": util.DateTime2ColorHTML,
@@ -43,6 +53,7 @@ var tmpl = template.Must(template.New("pem2html").
<th>Logged</th>
<th>NotBefore</th>
<th>NotAfter</th>
+ <th>Type</th>
<th>Subject.CN</th>
<th>Issuer.O</th>
</tr>
@@ -51,6 +62,7 @@ var tmpl = template.Must(template.New("pem2html").
<td style="background-color: {{$cert.Updated | green}}"><a target="_blank" href="{{$cert.Url}}">{{$cert.Updated | date}}</a></td>
<td style="background-color: {{$cert.X509.NotBefore | green}}"><a target="_blank" href="{{$cert.Url}}">{{$cert.X509.NotBefore | date}}</a></td>
<td style="background-color: {{$cert.X509.NotAfter | red }}"><a target="_blank" href="{{$cert.Url}}">{{$cert.X509.NotAfter | date}}</a></td>
+ <td><a target="_blank" href="{{$cert.Url}}">{{$cert.X509 | rfc6962type}}</a></td>
<td><a target="_blank" href="{{$cert.Url}}">{{$cert.X509.Subject.CommonName}}</a></td>
<td><a target="_blank" href="{{$cert.Url}}">{{$cert.X509.Issuer.Organization}}</a></td>
</tr>
diff --git a/bin-src/util/oid.go b/bin-src/util/oid.go
new file mode 100644
index 0000000..b9fee4c
--- /dev/null
+++ b/bin-src/util/oid.go
@@ -0,0 +1,10 @@
+package util
+
+import (
+ "encoding/asn1"
+)
+
+var (
+ OID_RFC6962_SCTs = asn1.ObjectIdentifier{1, 3, 6, 1, 4, 1, 11129, 2, 4, 2}
+ OID_RFC6962_Poison = asn1.ObjectIdentifier{1, 3, 6, 1, 4, 1, 11129, 2, 4, 3}
+)