...

Text file src/github.com/Microsoft/hcsshim/internal/cosesign1/Makefile.certs

Documentation: github.com/Microsoft/hcsshim/internal/cosesign1

     1all: chain.pem
     2
     3%.private.pem:
     4	openssl ecparam -name secp384r1 -genkey -noout -out $@
     5
     6%.public.pem: %.private.pem
     7	openssl ec -in $< -pubout -out $@
     8
     9root.cert.pem: root.private.pem
    10	openssl req -new -key $< -out $@.tmp.csr -subj "/CN=Test Root CA (DO NOT TRUST)" -addext 'basicConstraints=critical,CA:TRUE' -addext 'keyUsage=digitalSignature,keyCertSign' 
    11	openssl x509 -req -days 365 -in $@.tmp.csr -signkey $< -out $@ -CAcreateserial -extfile cert.extensions.cfg
    12	rm -rf $@.tmp.csr
    13
    14intermediate.cert.pem: intermediate.private.pem | root.private.pem
    15	openssl req -new -key $< -out $@.tmp.csr -subj "/CN=Test Intermediate CA (DO NOT TRUST)" -addext 'basicConstraints=critical,CA:TRUE' -addext 'keyUsage=digitalSignature,keyCertSign' 
    16	openssl x509 -req -days 365 -in $@.tmp.csr -CA ${subst private,cert,$|} -CAkey $| -out $@ -CAcreateserial -extfile cert.extensions.cfg
    17	rm $@.tmp.csr
    18
    19leaf.cert.pem: leaf.private.pem | intermediate.private.pem
    20	openssl req -new -key $< -out $@.tmp.csr -subj "/CN=Test Leaf (DO NOT TRUST)"
    21	openssl x509 -req -days 365 -in $@.tmp.csr -CA ${subst private,cert,$|} -CAkey $| -out $@ -CAcreateserial
    22	rm -rf $@.tmp.csr
    23
    24chain.pem: root.cert.pem intermediate.cert.pem leaf.cert.pem | root.public.pem intermediate.public.pem leaf.public.pem
    25	rm -rf $@
    26	cat `(for d in $^; do echo $$d; done) | tac` >> $@
    27
    28clean:
    29	rm -f chain.pem root.*.pem intermediate.*.pem leaf.*.pem *.tmp.csr *.cert.srl

View as plain text