source: examples/alice_rt1_typed/R @ da5afdf

mei_rt2mei_rt2_fix_1meiyap-rt1rt2
Last change on this file since da5afdf was da5afdf, checked in by Mei <mei@…>, 13 years ago

1) add static contraint

(limited to integer at this time)

  • Property mode set to 100755
File size: 10.1 KB
Line 
1#!/bin/sh
2
3## trying out different data param types
4
5rm -rf *.der *.pem
6
7creddy --generate --cn Alice
8creddy --generate --cn Hatter
9creddy --generate --cn MarchHare
10creddy --generate --cn Dormouse
11creddy --generate --cn Tea
12creddy --generate --cn Party
13
14alice_keyid=`creddy --keyid --cert Alice_ID.pem`
15party_keyid=`creddy --keyid --cert Party_ID.pem`
16tea_keyid=`creddy --keyid --cert Tea_ID.pem`
17hatter_keyid=`creddy --keyid --cert Hatter_ID.pem`
18marchhare_keyid=`creddy --keyid --cert MarchHare_ID.pem`
19dormouse_keyid=`creddy --keyid --cert Dormouse_ID.pem`
20
21friendof_alice="friendOf([keyid:$alice_keyid])"
22friendof_marchhare="friendOf([keyid:$marchhare_keyid])"
23guestof_marchhare="guestOf([keyid:$marchhare_keyid])"
24
25about_party="about([keyid:$tea_keyid],[time:20101010T],[boolean:true],[integer:4],[float:-200.0],[float:8],[time:20120205T182930],[string:'guest list'],[urn:'file://usr/local/party/~teaparty'])"
26
27about_other_party="about_other_party([keyid:$tea_keyid],[?],[integer:99],[time:?AAA],[integer:?BBB],[boolean:true])"
28about_time="about_time([time:20201101T])"
29about_another_time="about_another_time([time:20201101T182930])"
30about_key="about_key([keyid:$tea_keyid])"
31about_boolean="about_boolean([boolean:true])"
32about_integer="about_integer([integer:4])"
33about_another_integer="about_another_integer([integer:-7])"
34about_float="about_float([float:-200.0])"
35about_another_float="about_another_float([float:8])"
36about_third_float="about_another_float([float:0.22])"
37about_urn="about_urn([urn:'file://user/local/party/~sillyparty'])"
38about_string="about_string([string:'a confused party'])"
39about_string2="about_string([string:'a mangled \'string\''])"
40
41
42#[keyid:Party].role:about([keyid:tea],[time:201010],[string:'guest list'],[boolean:true],[integer:4]) <- [keyid:Party].role:guestOf([keyid:MarchHare])
43echo "creddy --attribute --issuer Party_ID.pem --key Party_private.pem --role \"$about_party\" --subject-cert Party_ID.pem --subject-role  \"$guestof_marchhare\" --out party_about_party__guestof_marchhare_attr.der"
44creddy --attribute \
45       --issuer Party_ID.pem --key Party_private.pem --role "$about_party" \
46       --subject-cert Party_ID.pem --subject-role  "$guestof_marchhare" \
47       --out party_about_party__guestof_marchhare_attr.der
48#echo "  "
49#echo "double checking with creddy --roles -certs party_about_party__guestof_marchhare_attr.der"
50#creddy --roles --cert party_about_party__guestof_marchhare_attr.der
51
52#[keyid:Party].role:about_other_party([keyid:$tea_keyid],[time:?],[boolean:true]) <- [keyid:MarchHare]
53echo "creddy --attribute --issuer Party_ID.pem --key Party_private.pem --role \"$about_other_party\" --subject-cert MarchHare_ID.pem --out party_about_other_party__marchhare_attr.der"
54creddy --attribute \
55       --issuer Party_ID.pem --key Party_private.pem --role "$about_other_party" \
56       --subject-cert MarchHare_ID.pem \
57       --out party_about_other_party__marchhare_attr.der
58
59#[keyid:Party].role:about_string([string:'a confused party']) <- [keyid:MarchHare]
60echo "creddy --attribute --issuer Party_ID.pem --key Party_private.pem --role \"$about_string\" --subject-cert MarchHare_ID.pem --out party_about_string__marchhare_attr.der"
61creddy --attribute \
62       --issuer Party_ID.pem --key Party_private.pem --role "$about_string" \
63       --subject-cert MarchHare_ID.pem \
64       --out party_about_string__marchhare_attr.der
65
66#[keyid:Party].role:about_string2([string:'a mangled \'string\'']) <- [keyid:MarchHare]
67#echo "creddy --attribute --issuer Party_ID.pem --key Party_private.pem --role \"$about_string2\" --subject-cert MarchHare_ID.pem --out party_about_string2__marchhare_attr.der"
68creddy --attribute \
69       --issuer Party_ID.pem --key Party_private.pem --role "$about_string2" \
70       --subject-cert MarchHare_ID.pem \
71       --out party_about_string2__marchhare_attr.der
72
73#[keyid:Party].role:about_urn([urn:'file://user/local/party/~sillyparty']) <- [keyid:MarchHare]
74echo "creddy --attribute --issuer Party_ID.pem --key Party_private.pem --role \"$about_urn\" --subject-cert MarchHare_ID.pem --out party_about_urn__marchhare_attr.der"
75creddy --attribute \
76       --issuer Party_ID.pem --key Party_private.pem --role "$about_urn" \
77       --subject-cert MarchHare_ID.pem \
78       --out party_about_urn__marchhare_attr.der
79
80#[keyid:Party].role:about_third_float([float:0.22]) <- [keyid:MarchHare]
81echo "creddy --attribute --issuer Party_ID.pem --key Party_private.pem --role \"$about_third_float\" --subject-cert MarchHare_ID.pem --out party_about_third_float__marchhare_attr.der"
82creddy --attribute \
83       --issuer Party_ID.pem --key Party_private.pem --role "$about_third_float" \
84       --subject-cert MarchHare_ID.pem \
85       --out party_about_third_float__marchhare_attr.der
86
87#[keyid:Party].role:about_another_float([float:8]) <- [keyid:MarchHare]
88echo "creddy --attribute --issuer Party_ID.pem --key Party_private.pem --role \"$about_another_float\" --subject-cert MarchHare_ID.pem --out party_about_another_float__marchhare_attr.der"
89creddy --attribute \
90       --issuer Party_ID.pem --key Party_private.pem --role "$about_another_float" \
91       --subject-cert MarchHare_ID.pem \
92       --out party_about_another_float__marchhare_attr.der
93
94#[keyid:Party].role:about_float([float:-200.0]) <- [keyid:MarchHare]
95echo "creddy --attribute --issuer Party_ID.pem --key Party_private.pem --role \"$about_float\" --subject-cert MarchHare_ID.pem --out party_about_float__marchhare_attr.der"
96creddy --attribute \
97       --issuer Party_ID.pem --key Party_private.pem --role "$about_float" \
98       --subject-cert MarchHare_ID.pem \
99       --out party_about_float__marchhare_attr.der
100
101#[keyid:Party].role:about_another_integer([integer:-7]) <- [keyid:MarchHare]
102echo "creddy --attribute --issuer Party_ID.pem --key Party_private.pem --role \"$about_another_integer\" --subject-cert MarchHare_ID.pem --out party_about_another_integer__marchhare_attr.der"
103creddy --attribute \
104       --issuer Party_ID.pem --key Party_private.pem --role "$about_another_integer" \
105       --subject-cert MarchHare_ID.pem \
106       --out party_about_another_nteger__marchhare_attr.der
107
108#[keyid:Party].role:about_integer([integer:4]) <- [keyid:MarchHare]
109echo "creddy --attribute --issuer Party_ID.pem --key Party_private.pem --role \"$about_integer\" --subject-cert MarchHare_ID.pem --out party_about_integer__marchhare_attr.der"
110creddy --attribute \
111       --issuer Party_ID.pem --key Party_private.pem --role "$about_integer" \
112       --subject-cert MarchHare_ID.pem \
113       --out party_about_integer__marchhare_attr.der
114
115#[keyid:Party].role:about_boolean([boolean:true]) <- [keyid:MarchHare]
116echo "creddy --attribute --issuer Party_ID.pem --key Party_private.pem --role \"$about_boolean\" --subject-cert MarchHare_ID.pem --out party_about_boolean__marchhare_attr.der"
117creddy --attribute \
118       --issuer Party_ID.pem --key Party_private.pem --role "$about_boolean" \
119       --subject-cert MarchHare_ID.pem \
120       --out party_about_boolean__marchhare_attr.der
121
122#[keyid:Party].role:about_key([keyid:$tea_keyid]) <- [keyid:MarchHare]
123echo "creddy --attribute --issuer Party_ID.pem --key Party_private.pem --role \"$about_key\" --subject-cert MarchHare_ID.pem --out party_about_key__marchhare_attr.der"
124creddy --attribute \
125       --issuer Party_ID.pem --key Party_private.pem --role "$about_key" \
126       --subject-cert MarchHare_ID.pem \
127       --out party_about_key__marchhare_attr.der
128
129#[keyid:Party].role:about_another_time([time:20201101T182930]) <- [keyid:MarchHare]
130echo "creddy --attribute --issuer Party_ID.pem --key Party_private.pem --role \"$about_another_time\" --subject-cert MarchHare_ID.pem --out party_about_another_time__marchhare_attr.der"
131creddy --attribute \
132       --issuer Party_ID.pem --key Party_private.pem --role "$about_another_time" \
133       --subject-cert MarchHare_ID.pem \
134       --out party_about_another_time__marchhare_attr.der
135
136#[keyid:Party].role:about_time([time:20201101T]) <- [keyid:MarchHare]
137echo "creddy --attribute --issuer Party_ID.pem --key Party_private.pem --role \"$about_time\" --subject-cert MarchHare_ID.pem --out party_about_time__marchhare_attr.der"
138creddy --attribute \
139       --issuer Party_ID.pem --key Party_private.pem --role "$about_time" \
140       --subject-cert MarchHare_ID.pem \
141       --out party_about_time__marchhare_attr.der
142
143#[keyid:Party].role:guestof([principal:?V]) <- [keyid:Party].role:friendOf([principal:?V])
144echo "creddy --attribute --issuer Party_ID.pem --key Party_private.pem --role 'guestOf([principal:?V])' --subject-cert Party_ID.pem --subject-role 'friendOf([principal:?V])' --out party_guestof_qV__party_friendof_qV_attr.der"
145creddy --attribute \
146       --issuer Party_ID.pem --key Party_private.pem --role 'guestOf([principal:?V])' \
147       --subject-cert Party_ID.pem --subject-role  'friendOf([principal:?V])' \
148       --out party_guestof_qV__party_friendof_qV_attr.der
149
150#[keyid:Party].role:guests <- [keyid:Party].role:friendOf([keyid:MarchHare])
151echo "creddy --attribute --issuer Party_ID.pem --key Party_private.pem --role guests --subject-cert Party_ID.pem --subject-role  \"$friendof_marchhare\" --out party_guests__party_friendof_marchhare_attr.der"
152creddy --attribute \
153       --issuer Party_ID.pem --key Party_private.pem --role guests \
154       --subject-cert Party_ID.pem --subject-role  "$friendof_marchhare" \
155       --out party_guests__party_friendof_marchhare_attr.der
156
157#[keyid:Party].role:friendOf([keyid:MarchHare]) <- [keyid:Dormouse]
158echo "creddy --attribute --issuer Party_ID.pem --key Party_private.pem --role \"$friendof_marchhare\" --subject-cert Dormouse_ID.pem --out party_friendof_marchhare__dormouse_attr.der"
159creddy --attribute \
160       --issuer Party_ID.pem --key Party_private.pem --role "$friendof_marchhare" \
161       --subject-cert Dormouse_ID.pem \
162       --out party_friendof_marchhare__dormouse_attr.der
163
164#[keyid:Party].role:friendOf([keyid:Alice]) <- [keyid:Hatter]
165echo "creddy --attribute --issuer Party_ID.pem --key Party_private.pem --role \"$friendof_alice\" --subject-cert Hatter_ID.pem --out party_friendof_alice__hatter_attr.der"
166creddy --attribute \
167       --issuer Party_ID.pem --key Party_private.pem --role "$friendof_alice" \
168       --subject-cert Hatter_ID.pem \
169       --out party_friendof_alice__hatter_attr.der
170
171
Note: See TracBrowser for help on using the repository browser.