lenticular_cloud2/lenticular_cloud/views/pki.py

16 lines
433 B
Python
Raw Normal View History

2022-06-17 11:38:49 +00:00
from flask import Blueprint
from cryptography.hazmat.primitives import serialization
2022-06-17 11:38:49 +00:00
from ..lenticular_services import lenticular_services
from ..pki import pki
pki_views = Blueprint('pki', __name__, url_prefix='/')
@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)
return crl.public_bytes(encoding=serialization.Encoding.DER)