source: examples/example_scripts/python/abac_keyid.py @ c7df2ad

mei_rt2mei_rt2_fix_1
Last change on this file since c7df2ad was ba6027a, checked in by Mei <mei@…>, 12 years ago

1) modified code all around to add support for encrypted private key for

ID credential

2) add new abac_key_t structure (abac_key.c)
3) add new keycheck option to creddy
4) add 2 new test suites

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