blob: d9d1027ff45823752b4f2935c41f42f99b6c6264 [file] [log] [blame]
Piotr Jaszczyka4becf22018-05-29 13:35:11 +02001FILE=sample
2CA_PASSWD=onap
3SUBJ=/C=PL/ST=DL/L=Wroclaw/O=Nokia/OU=MANO
4CA=onap
5
6sign: $(FILE).crt
7
8clean:
9 rm -f *.crt *.key *.srl *.csr
10
11generate-ca-certificate: $(CA).crt
12
13generate-private-key: $(FILE).key
14
15create-public-key: $(FILE).pub
16
17create-sign-request: $(FILE).csr
18
19$(CA).crt:
20 openssl req -new -x509 -keyout $(CA).key -out $(CA).crt -days 365 -passout pass:$(CA_PASSWD) -subj "$(SUBJ)"
21
22$(FILE).key:
23 openssl genpkey -algorithm RSA -out $(FILE).key -pkeyopt rsa_keygen_bits:2048
24
25$(FILE).pub: $(FILE).key
26 openssl x509 -req -days 360 -in client.csr -CA $(CA).crt -CAkey $(CA).key -CAcreateserial -out client.crt
27
28$(FILE).csr: $(FILE).key
29 openssl req -new -sha256 -key $(FILE).key -out $(FILE).csr -subj "$(SUBJ)"
30
31$(FILE).crt: $(CA).crt $(FILE).csr
32 openssl x509 -req -days 360 -in $(FILE).csr -CA $(CA).crt -CAkey $(CA).key -out $(FILE).crt -CAcreateserial -passin pass:$(CA_PASSWD)
33