Skip to content

Commit

Permalink
Emit an event on cert verification (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdehoog authored Jan 11, 2025
1 parent 4743795 commit 190ccb9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/CertManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ contract CertManager is ICertManager {
using LibAsn1Ptr for Asn1Ptr;
using LibBytes for bytes;

event CertVerified(bytes32 indexed certHash);

// root CA certificate constants (don't store it to reduce contract size)
bytes32 public constant ROOT_CA_CERT_HASH = 0x311d96fcd5c5e0ccf72ef548e2ea7d4c0cd53ad7c4cc49e67471aed41d61f185;
uint64 public constant ROOT_CA_CERT_NOT_AFTER = 2519044085;
Expand Down Expand Up @@ -110,6 +112,8 @@ contract CertManager is ICertManager {
VerifiedCert({ca: ca, notAfter: notAfter, maxPathLen: maxPathLen, subjectHash: subjectHash, pubKey: pubKey});
_saveVerified(certHash, cert);

emit CertVerified(certHash);

return cert;
}

Expand Down

0 comments on commit 190ccb9

Please sign in to comment.