Changeset cd5b279 for fedd/federation
- Timestamp:
- Jul 5, 2012 3:44:51 PM (12 years ago)
- Branches:
- compt_changes, master
- Children:
- e062282
- Parents:
- 311ece3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/proof.py
r311ece3 rcd5b279 3 3 4 4 import ABAC 5 import Creddy 5 6 import sys 6 7 import os, os.path … … 9 10 from base64 import b64encode, b64decode 10 11 from xml.parsers.expat import ParserCreate 12 from tempfile import mkdtemp 13 from shutil import rmtree 11 14 12 15 class proof: … … 29 32 ids = set([c.issuer_cert() for c in self.creds]) 30 33 attrs = set([c.attribute_cert() for c in self.creds]) 31 return list(ids) + list(attrs) 34 out_ids = [] 35 d = mkdtemp() 36 for i, c in enumerate(ids): 37 try: 38 der_name = os.path.join(d, 'file%04d.der' % i) 39 pem_name = os.path.join(d, 'file%04d.pem' % i) 40 f = open(der_name, 'w') 41 f.write(c) 42 f.close() 43 44 cid = Creddy.ID(der_name) 45 46 tf = open(pem_name, 'w') 47 cid.write_cert(tf) 48 tf.close() 49 tf = open(pem_name, 'r') 50 out_ids.append(tf.read()) 51 tf.close() 52 except EnvironmentError, e: 53 print "Certs to creds Error: %s" % e 54 pass 55 rmtree(d) 56 57 return out_ids + list(attrs) 32 58 33 59 def __str__(self):
Note: See TracChangeset
for help on using the changeset viewer.