電子証明書の有効期間計算(Validity)【RFC5280】

有効期間の計算方法

RFC 5280 では、証明書の有効期間を開始時刻と終了時刻の両方を含むと定義している。

RFC 5280 4.1.2.5. Validity

The certificate validity period is the time interval during which the CA warrants that it will maintain information about the status of the certificate. The field is represented as a SEQUENCE of two dates: the date on which the certificate validity period begins (notBefore) and the date on which the certificate validity period ends (notAfter). Both notBefore and notAfter may be encoded as UTCTime or GeneralizedTime.

CAs conforming to this profile MUST always encode certificate validity dates through the year 2049 as UTCTime; certificate validity dates in 2050 or later MUST be encoded as GeneralizedTime. Conforming applications MUST be able to process validity dates that are encoded in either UTCTime or GeneralizedTime.

The validity period for a certificate is the period of time from notBefore through notAfter, inclusive.

https://datatracker.ietf.org/doc/html/rfc5280

太字部分の翻訳「証明書の有効期間は、notBeforeからnotAfterまでの期間である。

そのため、以下の場合、有効期間は1秒として扱われる。
開始時刻 00:00:00 GMT
終了時刻 00:00:00 GMT

また、1年の証明書は以下の期間で発行すれば、1年ちょうどになる。
2020年1月1日 12:00:00 GMT に開始
2021年1月1日 12:00:00 GMT に終了

notBefore(有効期間の開始):2020年1月1日 12:00:00 GMT
notAfter(有効期間の終了):2021年1月1日 11:59:59 GMT
※ notAfter(有効期間の終了)は、終了時刻の1秒前になる。

過去のインシデント

TLSサーバー証明書の発行およびCRL発行における1秒超過のインシデント(Bugzilla)。

IdenTrust: Issuance of certificates greater than 398 days
https://bugzilla.mozilla.org/show_bug.cgi?id=1663080

Let’s Encrypt: certificate lifetimes 90 days plus one second
https://bugzilla.mozilla.org/show_bug.cgi?id=1715455

KIR S.A.: Certificates issued greater than stated in CPS
https://bugzilla.mozilla.org/show_bug.cgi?id=1708965

Dhimyotis/Certigna: Certificates issued with validity periods greater than 398-days
https://bugzilla.mozilla.org/show_bug.cgi?id=1667744

Google Trust Services: CRL validity period set to expected value plus one second
https://bugzilla.mozilla.org/show_bug.cgi?id=1731164

タイトルとURLをコピーしました