Skip to content

Commit 9c22e07

Browse files
committed
feat: support explicit revocation timestamp override
Signed-off-by: Vitor Mattos <[email protected]>
1 parent 2ce642d commit 9c22e07

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

lib/Db/CrlMapper.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ public function revokeCertificate(
9090
?string $revokedBy = null,
9191
?DateTime $invalidityDate = null,
9292
?int $crlNumber = null,
93+
?DateTime $revokedAt = null,
9394
): Crl {
9495
$certificate = $this->findBySerialNumber($serialNumber);
9596
return $this->revokeCertificateEntity(
@@ -98,7 +99,8 @@ public function revokeCertificate(
9899
$comment,
99100
$revokedBy,
100101
$invalidityDate,
101-
$crlNumber
102+
$crlNumber,
103+
$revokedAt,
102104
);
103105
}
104106

@@ -109,6 +111,7 @@ public function revokeCertificateEntity(
109111
?string $revokedBy = null,
110112
?DateTime $invalidityDate = null,
111113
?int $crlNumber = null,
114+
?DateTime $revokedAt = null,
112115
): Crl {
113116
if (CRLStatus::from($certificate->getStatus()) !== CRLStatus::ISSUED) {
114117
throw new \InvalidArgumentException('Certificate is not in issued status');
@@ -118,7 +121,7 @@ public function revokeCertificateEntity(
118121
$certificate->setReasonCode($reason->value);
119122
$certificate->setComment($comment !== '' ? $comment : null);
120123
$certificate->setRevokedBy($revokedBy);
121-
$certificate->setRevokedAt(new DateTime());
124+
$certificate->setRevokedAt($revokedAt ?? new DateTime());
122125
$certificate->setInvalidityDate($invalidityDate);
123126
$certificate->setCrlNumber($crlNumber);
124127

0 commit comments

Comments
 (0)