This repository has been archived by the owner on Nov 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
71 lines (58 loc) · 2 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# SPDX-FileCopyrightText: 2024 Jomco B.V.
# SPDX-FileCopyrightText: 2024 Topsector Logistiek
# SPDX-FileContributor: Joost Diepenmaat <joost@jomco.nl
# SPDX-FileContributor: Remco van 't Veer <remco@jomco.nl>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
.PHONY: all lint test check clean test-certs jar
CA_SUBJECT="/CN=TEST-CA"
SERVER_SUBJECT="/CN=Satellite/serialNumber=EU.EORI.SERVER"
CLIENT_SUBJECT="/CN=Satellite/serialNumber=EU.EORI.CLIENT"
test/pem/ca.cert.pem:
mkdir -p test/pem
openssl req \
-x509 -newkey rsa:4096 -sha256 -days 365 -noenc \
-subj $(CA_SUBJECT) \
-addext keyUsage=keyCertSign \
-keyout test/pem/ca.key.pem \
-out test/pem/ca.cert.pem
test/pem/intermediate.cert.pem:
openssl req \
-x509 -newkey rsa:4096 -sha256 -days 365 -noenc \
-subj "/CN=INTERMEDIATE-CA" \
-addext keyUsage=keyCertSign \
-keyout test/pem/intermediate.key.pem \
-out test/pem/intermediate.cert.pem \
-CA test/pem/ca.cert.pem \
-CAkey test/pem/ca.key.pem
test/pem/server.cert.pem: test/pem/intermediate.cert.pem
openssl req \
-x509 -newkey rsa:4096 -sha256 -days 365 -noenc \
-subj $(SERVER_SUBJECT) \
-addext keyUsage=nonRepudiation \
-keyout test/pem/server.key.pem \
-out test/pem/server.cert.pem \
-CA test/pem/intermediate.cert.pem \
-CAkey test/pem/intermediate.key.pem
test/pem/client.cert.pem: test/pem/ca.cert.pem
openssl req \
-x509 -newkey rsa:4096 -sha256 -days 365 -noenc \
-keyout test/pem/client.key.pem \
-out test/pem/client.cert.pem \
-addext keyUsage=nonRepudiation \
-subj $(CLIENT_SUBJECT) \
-CA test/pem/intermediate.cert.pem \
-CAkey test/pem/intermediate.key.pem
test/pem/%.x5c.pem: test/pem/%.cert.pem test/pem/intermediate.cert.pem test/pem/ca.cert.pem
cat $^ >$@
test-certs: test/pem/ca.cert.pem test/pem/server.cert.pem test/pem/client.cert.pem test/pem/client.x5c.pem test/pem/server.x5c.pem
lint:
reuse lint
clojure -M:lint
test: test-certs
clojure -M:test
clean:
rm -rf classes target test/pem
check: test lint outdated
outdated:
clojure -M:outdated