Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,19 @@ When people need a list of root certificates, they often turn to Mozilla's. Howe

Several people have written quick scripts to try and convert this into PEM format, but they often miss something critical: some certificates are explicitly _distrusted_. These include the DigiNotar certificates and the misissued COMODO certificates. If you don't parse the trust records from the NSS data file, then you end up trusting these!

So this is a tool that I wrote for converting the NSS file to PEM format which is also aware of the trust records. It can be built with Go1. See http://golang.org/doc/install.html, but don't pass "-u release" when fetching the repository.
So this is a tool that was written for converting the NSS file to PEM format which is also aware of the trust records. It can be built with Go 1.3. See http://golang.org/doc/install.html, but don't pass "-u release" when fetching the repository.

Once you have Go installed please do the following:

% curl https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt -o certdata.txt
% go run convert_mozilla_certdata.go > certdata.new
% go run main.go > certdata.new

To use as a library import it like the following:

import "github.com/njones/nss/nss"

Then use:

output := nss.ParseInput(file)

This will give you a slice of nss.Blocks that contain the x509 cert along with a UTF-8 encode label. This can then be added to things like a TrustPool http://golang.org/pkg/crypto/x509/#CertPool
Loading