Beispiel #1
0
    print "Problem loading ID cert: %s" % e
    exit(1)

# load the id into the context
ctxt.load_id_chunk(id.cert_chunk())
# another way to load the id into the context
# ctxt.load_id(cream_id), not implemented
ctxt.load_id_chunk(cream_id.cert_chunk())

# create an attribute cert
attr = Attribute(id, "delicious", 1000)
attr.principal(cream_id.keyid())
attr.bake()

# load attribute cert into the context
ctxt.load_attribute_chunk(attr.cert_chunk())

# another way to load the attribute cert into the context,
# ctxt.load_attribute(attr)

# yet another way to load the attribute cert into the context,
attr.write_file(argv[3])
# ctxt.load_attribute_file(argv[3])

print '---------'
(credentials) = ctxt.credentials()
for credential in credentials:
    print "credential %s <- %s" % (credential.head().string(), credential.tail().string())
print '---------'