mirror of
https://github.com/dyzulk/trustlab-api.git
synced 2026-01-26 05:15:35 +07:00
feat: track and display issuer_serial for absolute CA chain clarity
This commit is contained in:
@@ -25,6 +25,7 @@ class CaCertificate extends Model
|
||||
'valid_to',
|
||||
'is_latest',
|
||||
'issuer_name',
|
||||
'issuer_serial',
|
||||
'cert_path',
|
||||
'der_path',
|
||||
'bat_path',
|
||||
|
||||
@@ -416,7 +416,8 @@ class OpenSslService
|
||||
'serial_number' => $newSerialHex,
|
||||
'valid_from' => date('Y-m-d H:i:s', $newInfo['validFrom_time_t']),
|
||||
'valid_to' => date('Y-m-d H:i:s', $newInfo['validTo_time_t']),
|
||||
'issuer_name' => $cert->ca_type === 'root' ? 'Self-Signed' : ($root ? $root->common_name : 'Unknown Root'),
|
||||
'issuer_name' => $cert->ca_type === 'root' ? $cert->common_name : ($root ? $root->common_name : 'Unknown Root'),
|
||||
'issuer_serial' => $cert->ca_type === 'root' ? $newSerialHex : ($root ? $root->serial_number : null),
|
||||
];
|
||||
|
||||
} finally {
|
||||
@@ -475,6 +476,7 @@ class OpenSslService
|
||||
'valid_from' => $newData['valid_from'],
|
||||
'valid_to' => $newData['valid_to'],
|
||||
'issuer_name' => $newData['issuer_name'],
|
||||
'issuer_serial' => $newData['issuer_serial'],
|
||||
'is_latest' => true,
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user