Changeset 1177 for TI12-security
- Timestamp:
- 14/06/06 16:38:50 (14 years ago)
- Location:
- TI12-security/trunk/python/NDG
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TI12-security/trunk/python/NDG/AttCert.py
r1176 r1177 697 697 698 698 699 def isValidTime(self, raiseExcep=False):699 def isValidTime(self, dtNow=None, raiseExcep=False): 700 700 """Check Attribute Certificate for expiry. Set raiseExcep to True 701 701 to raise an exception with a message indicating the nature of the … … 708 708 raise AttCertError("Not After datetime is not set") 709 709 710 dtNow = datetime.utcnow() 710 if dtNow is None: 711 dtNow = datetime.utcnow() 711 712 712 713 # Testing only -
TI12-security/trunk/python/NDG/CredWallet.py
r1176 r1177 16 16 # Temporary store of certificates for use with CredWallet reqAuthorisation() 17 17 import tempfile 18 19 # Check Attribute Certificate validity times 20 from datetime import datetime 21 from datetime import timedelta 18 22 19 23 # Keyword formatting/XML message creation for Attribute Authority WS … … 948 952 # Look in the wallet for an AC with the same issuer name 949 953 if aaName in self.__credentials: 950 # Existing Attribute Certificate found in wallet - return this 951 return self.__credentials[aaName] 954 # Existing Attribute Certificate found in wallet - Check that 955 # it will be valid for at least the next 2 hours 956 # 957 # TODO: Make this 2 hour offset a configurable parameter 958 # 959 # P J Kershaw 14/06/06 960 dtNow = datetime.utcnow() + datetime.timedelta(seconds=7200) 961 962 if self.__credentials[aaName].isValidTime(dtNow=dtNow): 963 return self.__credentials[aaName] 952 964 953 965
Note: See TracChangeset
for help on using the changeset viewer.