Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import copy
from Errors import *
from Validations import check_signature
class SignatureLTA:
def __init__(self, signatureLT_A, AH, check):
if check:
valid, _ = check_signature(signatureLT_A)
if not valid:
print("Erreur : Signature classe précédente invalide")
raise SignError("Erreur : Signature classe précédente invalide")
self.__signatureLT_A = signatureLT_A
if signatureLT_A.get_type()== "signature LT":
self.__certif_previous_horo = None
self.__CRL_horo = None
elif signatureLT_A.get_type() == "signature LTA":
previous_horo = signatureLT_A.get_horodatage()
certif_previous_horo = previous_horo.get_certificat_horo()
self.__certif_previous_horo = copy.deepcopy(certif_previous_horo)
self.__CRL_horo = copy.deepcopy(certif_previous_horo.get_prestataire().get_liste_revocation())
self.__horodatage = AH.demande_horodatage(signatureLT_A)
def get_signatureLT_A(self):
return self.__signatureLT_A
def get_horodatage(self):
return self.__horodatage
def get_certif_previous_horo(self):
return self.__certif_previous_horo
def get_CRL_horo(self):
return self.__CRL_horo
def get_type(self):
return "signature LTA"