source: tests/example_scripts/wiki/ctxtQuery3_setup.py

Last change on this file 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"""
3ctxtQuery3_setup.py
4 
5shows 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"""
15import os
16import ABAC
17
18a = ABAC.ID("A", 24 * 3600 * 365 * 20)
19a.write_cert_file("A_ID.pem")
20b = ABAC.ID("B", 24 * 3600 * 365 * 20)
21b.write_cert_file("B_ID.pem")
22c = ABAC.ID("C", 24 * 3600 * 365 * 20)
23c.write_cert_file("C_ID.pem")
24
25attr = ABAC.Attribute(a, "yes", 24 * 3600 * 365 * 20)
26attr.principal(c.keyid())
27attr.bake()
28attr.write_file("A_yes__C_attr.xml")
29
30attr2 = ABAC.Attribute(b, "no", 24 * 3600 * 365 * 20)
31attr2.principal(c.keyid())
32attr2.bake()
33attr2.write_file("B_no__C_attr.xml")
34
Note: See TracBrowser for help on using the repository browser.