d2i_ASN1_TIME( &crl->crl->lastUpdate, &buffer, signature.size() + data - buffer );
d2i_ASN1_TIME( &crl->crl->nextUpdate, &buffer, signature.size() + data - buffer );
}
+
+bool CRL::needsResign() {
+ time_t current;
+ time( ¤t );
+ current += 60 * 60;// 1 hour
+ auto time = X509_CRL_get_nextUpdate( crl.get() );
+
+ if( !time ) {
+ return true;
+ }
+
+ int cmp = X509_cmp_time( time, ¤t );
+ return cmp < 0;
+}