Revize d3bfacfc
Přidáno uživatelem Stanislav Král před asi 4 roky(ů)
src/controllers/certificates_controller.py | ||
---|---|---|
396 | 396 |
if cert is None: |
397 | 397 |
return E_NO_CERTIFICATES_FOUND, C_NOT_FOUND |
398 | 398 |
else: |
399 |
# certificate exists, fetch it's private key |
|
400 |
private_key = self.key_service.get_key(cert.private_key_id) |
|
401 |
if cert is None: |
|
402 |
return E_NO_CERT_PRIVATE_KEY_FOUND, C_INTERNAL_SERVER_ERROR |
|
403 |
else: |
|
404 |
# TODO public key can be extracted from a certificate |
|
405 |
# private key fetched, extract a public key from it |
|
406 |
public_key = self.key_service.get_public_key(private_key) |
|
407 |
return {"success": True, "data": public_key}, C_SUCCESS |
|
399 |
return {"success": True, "data": self.certificate_service.get_public_key_from_certificate(cert)}, C_SUCCESS |
Také k dispozici: Unified diff
Re #8573 - /api/certificates/{id}/public_key endpoint now does not extract public key from private key but does so directly from the certificate instead