Ejemplo n.º 1
0
 def get_not_after(self):
     """Get the 'not after' date field as seconds since the epoch."""
     validity = self.get_validity()
     not_after = validity['notAfter']
     return utils.asn1_time_to_timestamp(not_after)
Ejemplo n.º 2
0
 def get_not_after(self):
     """Get the 'not after' date field as seconds since the epoch."""
     not_after = self._lib.X509_get_notAfter(self._certObj)
     return utils.asn1_time_to_timestamp(not_after)
Ejemplo n.º 3
0
 def get_not_before(self):
     """Get the 'not before' date field as seconds since the epoch."""
     validity = self.get_validity()
     not_before = validity['notBefore']
     return utils.asn1_time_to_timestamp(not_before)
Ejemplo n.º 4
0
 def get_not_after(self):
     """Get the 'not after' date field as seconds since the epoch."""
     not_after = self._lib.X509_get_notAfter(self._certObj)
     return utils.asn1_time_to_timestamp(not_after)
Ejemplo n.º 5
0
 def get_not_before(self):
     """Get the 'not before' date field as seconds since the epoch."""
     not_before = self._lib.X509_get_notBefore(self._certObj)
     return utils.asn1_time_to_timestamp(not_before)
Ejemplo n.º 6
0
 def get_not_before(self):
     """Get the 'not before' date field as seconds since the epoch."""
     not_before = self._lib.X509_get_notBefore(self._certObj)
     return utils.asn1_time_to_timestamp(not_before)
Ejemplo n.º 7
0
 def get_not_after(self):
     """Get the 'not after' date field as seconds since the epoch."""
     validity = self.get_validity()
     not_after = validity['notAfter']
     return utils.asn1_time_to_timestamp(not_after)
Ejemplo n.º 8
0
 def get_not_before(self):
     """Get the 'not before' date field as seconds since the epoch."""
     validity = self.get_validity()
     not_before = validity['notBefore']
     return utils.asn1_time_to_timestamp(not_before)
Ejemplo n.º 9
0
 def test_post_2050(self):
     """Test date post 2050, which causes different encoding."""
     t = 2600000000
     asn1_time = utils.timestamp_to_asn1_time(t)
     res = utils.asn1_time_to_timestamp(asn1_time)
     self.assertEqual(t, res)
Ejemplo n.º 10
0
 def test_round_check(self):
     t = 0
     asn1_time = utils.timestamp_to_asn1_time(t)
     res = utils.asn1_time_to_timestamp(asn1_time)
     self.assertEqual(t, res)