Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(476)

Unified Diff: net/tools/ct_mapper/dump-ct.sh

Issue 1238413004: Framework for iterating over certificates in CT database from Chromium code. (not for review) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make samples page work Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/tools/ct_mapper/dump-ct.go ('k') | net/tools/ct_mapper/entry.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/ct_mapper/dump-ct.sh
diff --git a/net/tools/ct_mapper/dump-ct.sh b/net/tools/ct_mapper/dump-ct.sh
new file mode 100755
index 0000000000000000000000000000000000000000..5a65ea1e6544227ff8afed87497da88857ad10d1
--- /dev/null
+++ b/net/tools/ct_mapper/dump-ct.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+set -e
+
+if [ $# -ne 2 ] ; then
+ echo "This tool will extract all of the certificates in a CertificateTransparency database and write their raw DER to a single file. This is the input file for cert_mapper"
+ echo ""
+ echo "Usage: <input-path-to-ct-db> <output-path-to-dump>"
+ exit 1
+fi
+
+# Make sure GO is installed
+go version >/dev/null 2>&1 || { echo >&2 "ERROR: Need to have GO installed"; exit 1; }
+
+CT_DB_INPUT="$(readlink -f "$1")"
+OUT_PATH="$(readlink -f "$2")"
+
+ORIGINAL_GO_FILE=$( readlink -f "$(dirname "$0")/dump-ct.go" )
+
+MY_DIR=$(mktemp -d)
+
+echo "Created temporary directory: $MY_DIR"
+
+cd "$MY_DIR"
+export GOPATH="$MY_DIR"
+
+echo "Downloading agl's certificatetransparency code into $MY_DIR"
+go get github.com/agl/certificatetransparency
+
+mkdir mycttools
+DST_GO_FILE="mycttools/dump-ct.go"
+echo "Copying to $ORIGINAL_GO_FILE to $MY_DIR/$DST_GO_FILE"
+cp "$ORIGINAL_GO_FILE" "$MY_DIR/$DST_GO_FILE"
+
+echo "Executing dump-ct.go"
+go run "$DST_GO_FILE" "$CT_DB_INPUT" "$OUT_PATH"
+
+# Cleanup this temporary directory.
+echo "Cleaning up and deleting $MY_DIR"
+rm -rf "$MY_DIR"
« no previous file with comments | « net/tools/ct_mapper/dump-ct.go ('k') | net/tools/ct_mapper/entry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698