Example #1
0
 public static function parseSubKeyLine($string)
 {
     $tokens = explode(':', $string);
     $subKey = new SubKey();
     $subKey->setId($tokens[4]);
     $subKey->setLength($tokens[2]);
     $subKey->setAlgorithm($tokens[3]);
     $subKey->setCreationDate(self::_parseDate($tokens[5]));
     $subKey->setExpirationDate(self::_parseDate($tokens[6]));
     if (strpos($tokens[1], 'r') !== false) {
         $subKey->setRevoked(true);
     }
     if (strpos($tokens[11], 's') !== false) {
         $subKey->setCanSign(true);
     }
     if (strpos($tokens[11], 'e') !== false) {
         $subKey->setCanEncrypt(true);
     }
     if (strpos($tokens[11], 'c') !== false) {
         //certify
     }
     if (strpos($tokens[11], 'a') !== false) {
         //authentication
     }
     return $subKey;
 }