Skip to content

Commit 24f9857

Browse files
authored
Merge pull request #5708 from LibreSign/feat/show-field-of-certificate
fea: show field of certificate
2 parents a62dad8 + c5e7213 commit 24f9857

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

lib/Service/FileService.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,9 @@ private function loadSignersFromCertData(): void {
428428
if (!empty($signer['chain'][0]['name'])) {
429429
$this->fileData->signers[$index]['subject'] = $signer['chain'][0]['name'];
430430
}
431+
if (!empty($signer['chain'][0]['field'])) {
432+
$this->fileData->signers[$index]['field'] = $signer['chain'][0]['field'];
433+
}
431434
if (!empty($signer['chain'][0]['validFrom_time_t'])) {
432435
$this->fileData->signers[$index]['valid_from'] = (new DateTime('@' . $signer['chain'][0]['validFrom_time_t'], new \DateTimeZone('UTC')))->format(DateTimeInterface::ATOM);
433436
}

src/views/Validation.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,15 @@
194194
{{ signer.certificate_validation.label }}
195195
</template>
196196
</NcListItem>
197+
<NcListItem v-if="signer.opened && signer.field"
198+
class="extra"
199+
compact
200+
:name="t('libresign', 'Field:')">
201+
<template #name>
202+
<strong>{{ t('libresign', 'Field:') }}</strong>
203+
{{ signer.field }}
204+
</template>
205+
</NcListItem>
197206
<NcListItem v-if="signer.opened && signer.remote_address"
198207
class="extra"
199208
compact

tests/php/Unit/Service/FileServiceTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ function (self $self, FileService $service): void {
302302
'label' => 'Certificate issuer is unknown.',
303303
],
304304
'hash_algorithm' => 'RSA-SHA256',
305+
'field' => 'Signature1',
305306
],
306307
],
307308
]

0 commit comments

Comments
 (0)