3 mkdir
/tmp
/tutorial-scion-certs
&& cd /tmp
/tutorial-scion-certs
6 # Create voting and root keys and (self-signed) certificates for core ASes
8 scion-pki certificate create
--not-before="1970-01-01T00:00:00Z" --not-after="2124-01-01T00:00:00Z" --profile=sensitive-voting
<(echo '{"isd_as": "42-ffaa:1:1", "common_name": "42-ffaa:1:1 sensitive voting cert"}') sensitive-voting.pem sensitive-voting.key
9 scion-pki certificate create
--not-before="1970-01-01T00:00:00Z" --not-after="2124-01-01T00:00:00Z" --profile=regular-voting
<(echo '{"isd_as": "42-ffaa:1:1", "common_name": "42-ffaa:1:1 regular voting cert"}') regular-voting.pem regular-voting.key
10 scion-pki certificate create
--not-before="1970-01-01T00:00:00Z" --not-after="2124-01-01T00:00:00Z" --profile=cp-root
<(echo '{"isd_as": "42-ffaa:1:1", "common_name": "42-ffaa:1:1 cp root cert"}') cp-root.pem cp-root.key
14 scion-pki certificate create
--not-before="1970-01-01T00:00:00Z" --not-after="2124-01-01T00:00:00Z" --profile=cp-root
<(echo '{"isd_as": "42-ffaa:1:2", "common_name": "42-ffaa:1:2 cp root cert"}') cp-root.pem cp-root.key
18 scion-pki certificate create
--not-before="1970-01-01T00:00:00Z" --not-after="2124-01-01T00:00:00Z" --profile=sensitive-voting
<(echo '{"isd_as": "42-ffaa:1:3", "common_name": "42-ffaa:1:3 sensitive voting cert"}') sensitive-voting.pem sensitive-voting.key
19 scion-pki certificate create
--not-before="1970-01-01T00:00:00Z" --not-after="2124-01-01T00:00:00Z" --profile=regular-voting
<(echo '{"isd_as": "42-ffaa:1:3", "common_name": "42-ffaa:1:3 regular voting cert"}') regular-voting.pem regular-voting.key
22 # Create the TRC (Trust Root Configuration)
26 description = "Demo ISD 42"
31 core_ases = ["ffaa:1:1", "ffaa:1:2", "ffaa:1:3"]
32 authoritative_ases = ["ffaa:1:1", "ffaa:1:2", "ffaa:1:3"]
33 cert_files = ["AS1/sensitive-voting.pem", "AS1/regular-voting.pem", "AS1/cp-root.pem", "AS2/cp-root.pem", "AS3/sensitive-voting.pem", "AS3/regular-voting.pem"]
40 scion-pki trc payload
--out=tmp
/ISD42-B1-S1.pld.der
--template trc-B1-S1-pld.tmpl
43 # Sign and bundle the TRC
44 scion-pki trc sign tmp
/ISD42-B1-S1.pld.der AS
1/sensitive-voting.
{pem
,key
} --out tmp
/ISD42-B1-S1.AS1-sensitive.trc
45 scion-pki trc sign tmp
/ISD42-B1-S1.pld.der AS
1/regular-voting.
{pem
,key
} --out tmp
/ISD42-B1-S1.AS1-regular.trc
46 scion-pki trc sign tmp
/ISD42-B1-S1.pld.der AS
3/sensitive-voting.
{pem
,key
} --out tmp
/ISD42-B1-S1.AS3-sensitive.trc
47 scion-pki trc sign tmp
/ISD42-B1-S1.pld.der AS
3/regular-voting.
{pem
,key
} --out tmp
/ISD42-B1-S1.AS3-regular.trc
49 scion-pki trc combine tmp
/ISD42-B1-S1.AS
{1,3}-{sensitive
,regular
}.trc
--payload tmp
/ISD42-B1-S1.pld.der
--out ISD42-B1-S1.trc
52 # Create CA key and certificate for issuing ASes
54 scion-pki certificate create
--not-before="1970-01-01T00:00:00Z" --not-after="2124-01-01T00:00:00Z" --profile=cp-ca
<(echo '{"isd_as": "42-ffaa:1:1", "common_name": "42-ffaa:1:1 CA cert"}') cp-ca.pem cp-ca.key
--ca cp-root.pem
--ca-key cp-root.key
57 scion-pki certificate create
--not-before="1970-01-01T00:00:00Z" --not-after="2124-01-01T00:00:00Z" --profile=cp-ca
<(echo '{"isd_as": "42-ffaa:1:2", "common_name": "42-ffaa:1:2 CA cert"}') cp-ca.pem cp-ca.key
--ca cp-root.pem
--ca-key cp-root.key
60 # Create AS key and certificate chains
61 scion-pki certificate create
--not-before="1970-01-01T00:00:00Z" --not-after="2124-01-01T00:00:00Z" --profile=cp-as
<(echo '{"isd_as": "42-ffaa:1:1", "common_name": "42-ffaa:1:1 AS cert"}') AS
1/cp-as.pem AS
1/cp-as.key
--ca AS
1/cp-ca.pem
--ca-key AS
1/cp-ca.key
--bundle
62 scion-pki certificate create
--not-before="1970-01-01T00:00:00Z" --not-after="2124-01-01T00:00:00Z" --profile=cp-as
<(echo '{"isd_as": "42-ffaa:1:2", "common_name": "42-ffaa:1:2 AS cert"}') AS
2/cp-as.pem AS
2/cp-as.key
--ca AS
2/cp-ca.pem
--ca-key AS
2/cp-ca.key
--bundle
63 scion-pki certificate create
--not-before="1970-01-01T00:00:00Z" --not-after="2124-01-01T00:00:00Z" --profile=cp-as
<(echo '{"isd_as": "42-ffaa:1:3", "common_name": "42-ffaa:1:3 AS cert"}') AS
3/cp-as.pem AS
3/cp-as.key
--ca AS
1/cp-ca.pem
--ca-key AS
1/cp-ca.key
--bundle
64 scion-pki certificate create
--not-before="1970-01-01T00:00:00Z" --not-after="2124-01-01T00:00:00Z" --profile=cp-as
<(echo '{"isd_as": "42-ffaa:1:4", "common_name": "42-ffaa:1:4 AS cert"}') AS
4/cp-as.pem AS
4/cp-as.key
--ca AS
1/cp-ca.pem
--ca-key AS
1/cp-ca.key
--bundle
65 scion-pki certificate create
--not-before="1970-01-01T00:00:00Z" --not-after="2124-01-01T00:00:00Z" --profile=cp-as
<(echo '{"isd_as": "42-ffaa:1:5", "common_name": "42-ffaa:1:5 AS cert"}') AS
5/cp-as.pem AS
5/cp-as.key
--ca AS
2/cp-ca.pem
--ca-key AS
2/cp-ca.key
--bundle
70 cp AS
$i/cp-as.
{key
,pem
} $out/AS
$i