abac0-leakabac0-mei
Last change
on this file since 2be12d2 was
7c748c9,
checked in by Mei <mei@…>, 11 years ago
|
1) more new tests
|
-
Property mode set to
100755
|
File size:
695 bytes
|
Line | |
---|
1 | #!/usr/bin/env python |
---|
2 | """ |
---|
3 | ctxtQuery3_setup.py |
---|
4 | |
---|
5 | shows auto loading of self-contained attribute |
---|
6 | |
---|
7 | externally, |
---|
8 | make a, |
---|
9 | make b, |
---|
10 | make c, |
---|
11 | make a.yes <- c |
---|
12 | make b.no <- c |
---|
13 | |
---|
14 | """ |
---|
15 | import os |
---|
16 | import ABAC |
---|
17 | |
---|
18 | a = ABAC.ID("A", 24 * 3600 * 365 * 20) |
---|
19 | a.write_cert_file("A_ID.pem") |
---|
20 | b = ABAC.ID("B", 24 * 3600 * 365 * 20) |
---|
21 | b.write_cert_file("B_ID.pem") |
---|
22 | c = ABAC.ID("C", 24 * 3600 * 365 * 20) |
---|
23 | c.write_cert_file("C_ID.pem") |
---|
24 | |
---|
25 | attr = ABAC.Attribute(a, "yes", 24 * 3600 * 365 * 20) |
---|
26 | attr.principal(c.keyid()) |
---|
27 | attr.bake() |
---|
28 | attr.write_file("A_yes__C_attr.xml") |
---|
29 | |
---|
30 | attr2 = ABAC.Attribute(b, "no", 24 * 3600 * 365 * 20) |
---|
31 | attr2.principal(c.keyid()) |
---|
32 | attr2.bake() |
---|
33 | attr2.write_file("B_no__C_attr.xml") |
---|
34 | |
---|
Note: See
TracBrowser
for help on using the repository browser.