Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 75ebc6fc

Přidáno uživatelem Jan Pašek před téměř 4 roky(ů)

Re #8576 - Fixed generating index file for generating empty CRL

Zobrazit rozdíly:

src/services/crl/crl_service.py
6 6
from src.dao.private_key_repository import PrivateKeyRepository
7 7
from src.exceptions.certificate_not_found_exception import CertificateNotFoundException
8 8
from src.exceptions.private_key_not_found_exception import PrivateKeyNotFoundException
9
from src.services.crl.ca_index_file_line_generator import create_index_file_revoked_line
9
from src.services.crl.ca_index_file_line_generator import create_index_file_revoked_line, create_index_file_valid_line
10 10
from src.services.cryptography import CryptographyService
11 11
from src.utils.temporary_file import TemporaryFile
12 12

  
......
30 30
        :param ca_id: ID of the CA whose revoked certificates should be put into the index file
31 31
        :return: a str representing the content of a CA index file
32 32
        """
33
        # get issuing certificate
34
        certificate = self.certificate_repository.read(ca_id)
35
        if certificate is None:
36
            raise CertificateNotFoundException(ca_id)
37

  
38
        # get subject and notAfter of the issuer
39
        subject, _, not_after = self.cryptography_service.parse_cert_pem(certificate.pem_data)
33 40

  
34
        index_lines = []
41
        index_lines = [create_index_file_valid_line(certificate, subject, not_after)]
35 42
        # iterate over revoked certificates of the CA given by an ID
36 43
        for certificate in self.certificate_repository.get_all_revoked_by(ca_id):
37 44
            # extract the complete subject information and not_after date field

Také k dispozici: Unified diff