From 65402b26f57004a2386892f0e6a209f040c6637f Mon Sep 17 00:00:00 2001 From: Matthew McPherrin Date: Wed, 4 Jan 2017 15:39:24 -0800 Subject: [PATCH] Make a test cert with a custom OID in the DN --- test-certs/Makefile | 10 +++++++++- test-certs/example-custom-oid.conf | 12 ++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 test-certs/example-custom-oid.conf diff --git a/test-certs/Makefile b/test-certs/Makefile index ce9eee4..854235e 100644 --- a/test-certs/Makefile +++ b/test-certs/Makefile @@ -1,6 +1,7 @@ TARGETS = \ example-root example-leaf example-sha1 example-md5 example-root-bad-ku \ - example-bad-serial example-small-key example-expired example-elliptic-sha1 + example-bad-serial example-small-key example-expired example-elliptic-sha1 \ + example-custom-oid all: \ $(addsuffix .crt,$(TARGETS)) \ @@ -72,3 +73,10 @@ example-elliptic-sha1.key: example-elliptic-sha1.crt: example-elliptic-sha1.csr openssl x509 -req -in $< -signkey $(@:.crt=.key) -out $@ -days 2500 -extfile openssl.ext -extensions leaf + +# Custom OID +example-custom-oid.csr: example-custom-oid.key + openssl req -new -config example-custom-oid.conf -key $< -out $@ + +example-custom-oid.crt: example-custom-oid.csr + openssl x509 -req -sha256 -in $< -signkey $(@:.crt=.key) -out $@ -days 2500 -extfile openssl.ext -extensions leaf diff --git a/test-certs/example-custom-oid.conf b/test-certs/example-custom-oid.conf new file mode 100644 index 0000000..1126f55 --- /dev/null +++ b/test-certs/example-custom-oid.conf @@ -0,0 +1,12 @@ +oid_section = OIDs + +[ req ] +distinguished_name = dn +prompt = no + +[ OIDs ] +CustomTestOID=1.3.6.1.4.1.36914 + +[ dn ] +CN = example-custom-oids +CustomTestOID = example