blob: 283265053ed60aaff32c1c256ceed3515467e82b [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
Jakub Dudycz85439492018-06-08 12:57:13 +02004CA=trust
Piotr Jaszczyka4becf22018-05-29 13:35:11 +02005
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