+ if( ( parsed = parseDate( cert->wishTo ) ).first /*is of yyyy-mm-dd */ ) {
+ if( parsed.second > from ) {
+ to = parsed.second;
+ } else {
+ to = from + /*2 Years */ 2 * 365 * 24 * 60 * 60;
+ }
+ } else if( ( parsed = parseYearInterval( from, cert->wishTo ) ).first /*is of [0-9]+y */ ) {
+ to = parsed.second;
+ } else if( ( parsed = parseMonthInterval( from, cert->wishTo ) ).first /*is of [0-9]+m */ ) {
+ to = parsed.second;
+ } else {
+ to = from + /*2 Years */ 2 * 365 * 24 * 60 * 60;
+ }
+
+ time_t limit = prof.maxValidity;
+
+ if( (to - from > limit) || (to - from < 0) ) {
+ to = from + limit;
+ }
+
+ c.setTimes( from, to );
+ signlog << "FINE: Setting validity period successful:" << std::endl;
+ signlog << "FINE: - Valid not before: " << timeToString(from) << std::endl;
+ signlog << "FINE: - Valid not after: " << timeToString(to) << std::endl;
+ }
+
+ signlog << "INFO: Setting extensions:" << std::endl;
+ c.setExtensions( ca->ca, cert->SANs, prof );
+ signlog << "FINE: Setting extensions successful." << std::endl;
+
+ signlog << "INFO: Generating next Serial Number ..." << std::endl;