-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathentrust.go
39 lines (32 loc) · 882 Bytes
/
entrust.go
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
27
28
29
30
31
32
33
34
35
36
37
38
39
package main
import (
"flag"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
var domain string
flag.StringVar(&domain, "domain", "", "Domain to search for CT logs")
flag.Parse()
fmt.Println(domain)
entrustcertsearch(domain)
}
func entrustcertsearch(domain string) {
APIURL := fmt.Sprintf("https://ctsearch.entrust.com/api/v1/certificates?fields=issuerCN,subjectO,issuerDN,issuerO,subjectDN,signAlg,san,publicKeyType,publicKeySize,validFrom,validTo,sn,ev,logEntries.logName,subjectCNReversed&domain=%s&includeExpired=false&exactMatch=false&limit=5000", domain)
req, err := http.NewRequest(http.MethodGet, APIURL, nil)
if err != nil {
panic(err)
}
client := http.DefaultClient
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
panic(err)
}
fmt.Printf(string(body))
}