Exemplo n.º 1
0
    def _getExpiration(self):
        expiration = self._getOptionValue("-e")

        if expiration is None and self._getTackCount() is None:
            return int(math.ceil(self._getCertificate().notAfter / 60.0))
        else:
            try:
                return Time.parseTimeArg(expiration)
            except SyntaxError as e:
                self.printError(e)
Exemplo n.º 2
0
    def _getExpiration(self, certificate):
        expiration = self._getOptionValue("-e")

        if expiration is None and self._getNumArg() is None:
            return int(math.ceil(certificate.notAfter / 60.0))
        else:
            try:
                return Time.parseTimeArg(expiration)
            except SyntaxError as e:
                self.printError(e)
Exemplo n.º 3
0
    def _getExpiration(self, certificate):
        expiration = self._getOptionValue("-e")

        if expiration is None and self._getNumArg() is None:
            # Set expiration based on cert + 30 days (per spec's advice)
            return int(math.ceil(certificate.notAfter / 60.0)) + (30*24*60)
        else:
            try:
                return Time.parseTimeArg(expiration)
            except SyntaxError as e:
                self.printError(e)
Exemplo n.º 4
0
    def _getExpiration(self, certificate):
        expiration = self._getOptionValue("-e")

        if expiration is None and self._getNumArg() is None:
            # Set expiration based on cert + 30 days (per spec's advice)
            return int(math.ceil(certificate.notAfter / 60.0)) + (30 * 24 * 60)
        else:
            try:
                return Time.parseTimeArg(expiration)
            except SyntaxError as e:
                self.printError(e)
Exemplo n.º 5
0
 def test_string(self):
     assert (Time.parseTimeArg("2012-07-20T05:40Z") * 60 == 1342762800)
     assert (Time.parseTimeArg("2012-07-20T05Z") * 60 == 1342760400)
     assert (Time.parseTimeArg("2012-07-20Z") * 60 == 1342742400)
     assert (Time.parseTimeArg("2012-07Z") * 60 == 1341100800)
     assert (Time.parseTimeArg("2012Z") * 60 == 1325376000)
Exemplo n.º 6
0
 def test_string(self):
     assert(Time.parseTimeArg("2012-07-20T05:40Z")*60 == 1342762800)
     assert(Time.parseTimeArg("2012-07-20T05Z")*60 == 1342760400)
     assert(Time.parseTimeArg("2012-07-20Z")*60 == 1342742400)
     assert(Time.parseTimeArg("2012-07Z")*60 == 1341100800)
     assert(Time.parseTimeArg("2012Z")*60 == 1325376000)