Revize ca31a7f7
Přidáno uživatelem Stanislav Král před téměř 4 roky(ů)
src/services/crl/crl_service.py | ||
---|---|---|
1 |
import time
|
|
1 |
from datetime import datetime
|
|
2 | 2 |
|
3 | 3 |
from injector import inject |
4 | 4 |
|
5 | 5 |
from src.dao.certificate_repository import CertificateRepository |
6 |
from src.services.certificate_service import VALID_FROM_TO_DATE_FORMAT |
|
7 | 6 |
from src.services.crl.ca_index_file_line_generator import create_index_file_revoked_line |
8 | 7 |
from src.services.cryptography import CryptographyService |
9 | 8 |
|
... | ... | |
31 | 30 |
for certificate in self.certificate_repository.get_all_revoked_by(ca_id): |
32 | 31 |
# extract the complete subject information and not_after date field |
33 | 32 |
subject, _, not_after = self.cryptography_service.parse_cert_pem(certificate.pem_data) |
33 |
|
|
34 | 34 |
line = create_index_file_revoked_line(certificate, |
35 | 35 |
subject, |
36 |
# parse valid_to date to a date struct
|
|
37 |
time.strptime(certificate.valid_to, VALID_FROM_TO_DATE_FORMAT),
|
|
36 |
# parse revocation date from unix timestamp to struct_time
|
|
37 |
datetime.utcfromtimestamp(int(certificate.revocation_date)).timetuple(),
|
|
38 | 38 |
not_after) |
39 | 39 |
|
40 | 40 |
# append it to the list of lines |
Také k dispozici: Unified diff
Re #8575 - Fixed an issue where when creating an index file the valid_to field was passed instead of the revocation_date field