Re: [go-nuts] [crypto/x509] SystemCertPool() print subjects of ca certs

2018-10-31 Thread Natxo Asenjo
On Wednesday, October 31, 2018 at 10:46:41 PM UTC+1, golan...@geek1.de wrote: > > Hy Natxo, > > check out the pkix [0] and asn1 [1] packages. You can try to parse the > DER encoded subject into RDNSequence. > > [0]: https://golang.org/pkg/crypto/x509/pkix/#RDNSequence > [1]: https://golang.o

Re: [go-nuts] [crypto/x509] SystemCertPool() print subjects of ca certs

2018-10-31 Thread golang-nuts via golang-nuts
Hy Natxo, check out the pkix [0] and asn1 [1] packages. You can try to parse the DER encoded subject into RDNSequence. [0]: https://golang.org/pkg/crypto/x509/pkix/#RDNSequence [1]: https://golang.org/pkg/encoding/asn1/#Unmarshal Spoiler: This should work: package main import "fmt" import "cr

[go-nuts] [crypto/x509] SystemCertPool() print subjects of ca certs

2018-10-31 Thread Natxo Asenjo
hi, as a learning exercise I would lke to loop through the system's certificate authorities store, and get the subjects of each certificate authority. I have this code: package main import "fmt" import "crypto/x509" func main() { store, err := x509.SystemCertPool() if err != nil {