2022-06-17 11:38:49 +00:00
|
|
|
from flask import Blueprint
|
2020-05-25 18:23:27 +00:00
|
|
|
from cryptography.hazmat.primitives import serialization
|
2022-06-17 11:38:49 +00:00
|
|
|
from ..lenticular_services import lenticular_services
|
|
|
|
from ..pki import pki
|
2020-05-25 18:23:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
pki_views = Blueprint('pki', __name__, url_prefix='/')
|
|
|
|
|
2020-05-26 20:55:37 +00:00
|
|
|
|
2020-05-25 18:23:27 +00:00
|
|
|
@pki_views.route('/<service_name>.crl')
|
|
|
|
def crl(service_name: str):
|
2022-06-17 11:38:49 +00:00
|
|
|
service = lenticular_services[service_name]
|
|
|
|
crl = pki.get_crl(service)
|
2020-05-25 18:23:27 +00:00
|
|
|
return crl.public_bytes(encoding=serialization.Encoding.DER)
|
|
|
|
|