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)
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)
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)
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)
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)
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)