Beispiel #1
0
 /**
  * Set certificate end date
  *
  * @param String $date
  * @access public
  */
 function setEndDate($date)
 {
     /*
       To indicate that a certificate has no well-defined expiration date,
       the notAfter SHOULD be assigned the GeneralizedTime value of
       99991231235959Z.
     
       -- http://tools.ietf.org/html/rfc5280#section-4.1.2.5
     */
     if (strtolower($date) == 'lifetime') {
         $temp = '99991231235959Z';
         $asn1 = new File_ASN1();
         $temp = chr(FILE_ASN1_TYPE_GENERALIZED_TIME) . $asn1->_encodeLength(strlen($temp)) . $temp;
         $this->endDate = new File_ASN1_Element($temp);
     } else {
         $this->endDate = @date('M j H:i:s Y T', @strtotime($date));
     }
 }