Changeset 740
- Timestamp:
- 31/03/06 14:58:55 (15 years ago)
- Location:
- TI12-security/trunk/python/NDG
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TI12-security/trunk/python/NDG/CredWallet.py
r739 r740 548 548 549 549 except IOError, (errNo, errMsg): 550 raise SessionMgrError(\550 raise CredWalletError(\ 551 551 "Writing public key to temporary file: %s" % errMsg) 552 552 553 553 except Exception, e: 554 raise SessionMgrError(\554 raise CredWalletError(\ 555 555 "Retrieving Attribute Authority public key: "+ str(e)) 556 556 … … 722 722 723 723 except IOError, (errNo, errMsg): 724 raise SessionMgrError(\724 raise CredWalletError(\ 725 725 "Writing public key to temporary file: %s" % errMsg) 726 726 727 727 except Exception, e: 728 raise SessionMgrError(\728 raise CredWalletError(\ 729 729 "Retrieving Attribute Authority public key: "+ str(e)) 730 730 … … 1076 1076 tempFile.name) 1077 1077 except Exception, e: 1078 raise SessionMgrError("Error retrieving from URI " + \1078 raise CredWalletError("Error retrieving from URI " + \ 1079 1079 "\"%s\": %s" % (uri, str(e))) 1080 1080 … … 1082 1082 # 404 error would come back as 'text/html' 1083 1083 if 'text/plain' not in httpResp['Content-type']: 1084 raise SessionMgrError("Error retrieving from URI " + \1084 raise CredWalletError("Error retrieving from URI " + \ 1085 1085 "\"%s\": expecting \"plain/text\"" % uri) 1086 1086 -
TI12-security/trunk/python/NDG/Session.py
r739 r740 49 49 # Tools for interfacing with SessionMgr WS 50 50 from NDG.SessionMgrIO import * 51 52 # SessionMgr.reqAuthorisation - getPubKey WS call. Don't import 53 # AttAuthorityIO's namespace as it would conflict with SessionMgrIO's 54 from NDG import AttAuthorityIO 51 55 52 56 # Use client package to allow reidrection of authorisation requests … … 839 843 840 844 841 # Make a temporary file to hold Attribute Authority Public Key. The 842 # Credential Wallet needs this to encrypt requests to the Attribute 843 # Authority 845 if 'aaPubKey' not in reqKeys: 846 # Get public key using WS 847 try: 848 aaSrv = ServiceProxy(reqKeys['aaWSDL'], use_wsdl=True) 849 850 pubKeyReq = AttAuthorityIO.PubKeyReq() 851 resp = aaSrv.getPubKey(pubKeyReq=pubKeyReq()) 852 853 pubKeyResp = AttAuthorityIO.PubKeyResp(\ 854 xmlTxt=resp['pubKeyResp']) 855 856 if 'errMsg' in pubKeyResp and pubKeyResp['errMsg']: 857 raise Exception(pubKeyResp['errMsg']) 858 859 reqKeys['aaPubKey'] = pubKeyResp['pubKey'] 860 861 except Exception, e: 862 raise SessionMgrError(\ 863 "Retrieving Attribute Authority public key: "+ str(e)) 864 865 866 # Make a temporary file to hold Attribute Authority Public Key. 867 # The Credential Wallet needs this to encrypt requests to the 868 # Attribute Authority 844 869 try: 845 870 aaPubKeyTmpFile = tempfile.NamedTemporaryFile() … … 847 872 aaKeys['aaPubKeyFilePath'] = aaPubKeyTmpFile.name 848 873 874 except IOError, (errNo, errMsg): 875 raise SessionMgrError("Making temporary file for Attribute " + \ 876 "Authority public key: %s" % errMsg) 877 849 878 except Exception, e: 850 879 raise SessionMgrError("Making temporary file for Attribute " + \ 851 880 "Authority public key: %s" % str(e)) 852 881 853 882 854 883 # User's Credential Wallet carries out authorisation request to the
Note: See TracChangeset
for help on using the changeset viewer.