source: tests/example_scripts/python/abac_keyid.py

Last change on this file was ec550f7, checked in by Mei <mei@…>, 11 years ago

1) reworked how API doc is generated
2) tweak top level Makefile.am
3) loading issuer principal as side-effect of loading

an attribute credentials

4) add examples of GENI specific attribute credentials

and principal certificates into the regression testing

5) rename examples to tests

  • Property mode set to 100755
File size: 599 bytes
Line 
1#!/usr/bin/env python
2
3"""
4  abac_keyid.py
5
6   To demonstrate how to use ABAC's api in python to access keyid of a
7principal credential
8
9   pre-condition: generate IceCream_ID.pem and IceCream_private.pem with
10           creddy --generate --cn IceCream
11
12   keyid of the loaded principal credential is printed
13
14"""
15
16from sys import argv, exit
17from ABAC import ID
18
19if len(argv) < 2:
20    print "Usage: abac_keyid.py <cert.pem>"
21    exit(1)
22
23id = None
24try:
25    print argv[1]
26    id = ID(argv[1])
27except Exception, e:
28    print "Problem loading cert: %s" % e
29    exit(1)
30
31print id.keyid()
32print "okay"
33
Note: See TracBrowser for help on using the repository browser.