aboutsummaryrefslogtreecommitdiff
path: root/rpkid/rpki/sundial.py
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2012-10-26 02:57:36 +0000
committerRob Austein <sra@hactrn.net>2012-10-26 02:57:36 +0000
commit352e7b86cff4df11423871333b51b6c730dd9cbf (patch)
tree173b5529ca89bdfed5151fe3ea36505a555db203 /rpkid/rpki/sundial.py
parent11c501be2e1b20a277a5920afcab8eea44aa309c (diff)
Change POW representation of UTCTime and GeneralizedTime to use Python
datetime instead of OpenSSL-like GeneralizedTime strings. Clean up a lot of compiler warnings that gcc only reports with -Wextra. svn path=/branches/tk274/; revision=4791
Diffstat (limited to 'rpkid/rpki/sundial.py')
-rw-r--r--rpkid/rpki/sundial.py29
1 files changed, 0 insertions, 29 deletions
diff --git a/rpkid/rpki/sundial.py b/rpkid/rpki/sundial.py
index b8a78ea3..2f333b40 100644
--- a/rpkid/rpki/sundial.py
+++ b/rpkid/rpki/sundial.py
@@ -72,33 +72,6 @@ class datetime(pydatetime.datetime):
return int(self.strftime("%s"))
@classmethod
- def fromUTCTime(cls, x):
- """
- Convert from ASN.1 UTCTime.
- """
- x = str(x)
- return cls.fromGeneralizedTime(("19" if x[0] >= "5" else "20") + x)
-
- def toUTCTime(self):
- """
- Convert to ASN.1 UTCTime.
- """
- return self.strftime("%y%m%d%H%M%SZ")
-
- @classmethod
- def fromGeneralizedTime(cls, x):
- """
- Convert from ASN.1 GeneralizedTime.
- """
- return cls.strptime(x, "%Y%m%d%H%M%SZ")
-
- def toGeneralizedTime(self):
- """
- Convert to ASN.1 GeneralizedTime.
- """
- return self.strftime("%Y%m%d%H%M%SZ")
-
- @classmethod
def fromXMLtime(cls, x):
"""
Convert from XML time representation.
@@ -284,8 +257,6 @@ if __name__ == "__main__":
print "str: ", t
print "repr: ", repr(t)
print "seconds since epoch:", t.strftime("%s")
- print "UTCTime: ", t.toUTCTime()
- print "GeneralizedTime: ", t.toGeneralizedTime()
print "XMLtime: ", t.toXMLtime()
print