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

Unified Diff: chrome/test/data/extensions/api_test/certificate_provider/create_test_certs.sh

Issue 1232553003: Add new certificateProvider extension API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 years, 3 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
Index: chrome/test/data/extensions/api_test/certificate_provider/create_test_certs.sh
diff --git a/chrome/test/data/extensions/api_test/platform_keys/create_test_certs.sh b/chrome/test/data/extensions/api_test/certificate_provider/create_test_certs.sh
similarity index 85%
copy from chrome/test/data/extensions/api_test/platform_keys/create_test_certs.sh
copy to chrome/test/data/extensions/api_test/certificate_provider/create_test_certs.sh
index 85c67f44693b139d798ece957c11e47eaf0f2a51..ecd1772b225dc93b709fa4da557191d7fbedb68a 100755
--- a/chrome/test/data/extensions/api_test/platform_keys/create_test_certs.sh
+++ b/chrome/test/data/extensions/api_test/certificate_provider/create_test_certs.sh
@@ -6,10 +6,8 @@
# Generates the following tree of certificates:
# root (self-signed root)
-# \ \
-# \ \--> l1_leaf (end-entity)
-# \
-# \----> l1_interm --> l2_leaf (end-entity)
+# \
+# \--> l1_leaf (end-entity)
try() {
"$@" || {
@@ -46,12 +44,12 @@ root_cert() {
# Create a cert with CommonName CN signed by CA_ID and store it at $1.der .
# $2 must either be "leaf_cert" (for a server/user cert) or "ca_cert" (for a
# intermediate CA).
+# Stores the private key at $1.pk8 .
issue_cert() {
if [[ "$2" == "ca_cert" ]]
then
try /bin/sh -c "echo 01 > out/${1}-serial"
try touch out/${1}-index.txt
- try openssl genrsa -out out/${1}.key 2048
fi
try openssl req \
-new \
@@ -66,6 +64,8 @@ issue_cert() {
-out out/${1}.pem \
-config ca.cnf
+ try openssl pkcs8 -topk8 -in out/${1}.key -out ${1}.pk8 -outform DER -nocrypt
+
try openssl x509 -in out/${1}.pem -outform DER -out out/${1}.der
try cp out/${1}.der ${1}.der
}
@@ -78,9 +78,3 @@ CN=root \
CA_ID=root CN=l1_leaf \
try issue_cert l1_leaf leaf_cert
-
-CA_ID=root CN=l1_interm \
- try issue_cert l1_interm ca_cert
-
-CA_ID=l1_interm CN=l2_leaf \
- try issue_cert l2_leaf leaf_cert

Powered by Google App Engine
This is Rietveld 408576698