date test_date1
date test_date2
+time_delta test_delta
test_date1 := %cipher_rsa.certificate('notBefore')
test_date2 := %cipher_rsa.certificate('notAfter')
-# Check the cert validity period is 30 days
-if !((test_date2 - test_date1) == ((time_delta) (86400 * 60))) {
+test_delta = (test_date2 - test_date1) - (time_delta) (86400 * 60)
+
+# Check the cert validity period is 30 days. Add fudge factor for issuance occuring across a second boundary
+if !((test_delta >= -1) && (test_delta <= 1)) {
test_fail
} else {
test_pass