summaryrefslogtreecommitdiff
path: root/bin-src/util/rfc6962.go
blob: 46a531b98e14dbdc17b9175def03ce0c884bfe13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package util

import (
	"crypto/x509"
	"encoding/asn1"

	//"fmt"
	//"os"
)

var (
	oidSCTs                 = asn1.ObjectIdentifier{1, 3, 6, 1, 4, 1, 11129, 2, 4, 2}
	oidPrecertificatePoison = asn1.ObjectIdentifier{1, 3, 6, 1, 4, 1, 11129, 2, 4, 3}
)

func IsPrecertificate(certX509 *x509.Certificate) bool {
	for _, ext := range certX509.Extensions {
		//fmt.Fprintln(os.Stderr, "ext", ext)	
		if ext.Id.Equal(oidPrecertificatePoison) {
			//fmt.Fprintln(os.Stderr, "t")
			return true
		}
	}
	//fmt.Fprintln(os.Stderr, "f")
	return false
}