Example #1
0
 /**
  * Returns the certficate data of the given user cert if possible.
  * Else returns false.
  * 
  * @return array|bool
  */
 public static function getCertificateInfo()
 {
     if (!self::canCreateCertificates()) {
         return false;
     }
     $instance = new self();
     $rsaPublicKey = $instance->_getCertRsaPublicKey();
     if ($rsaPublicKey === false) {
         return false;
     }
     $san = $instance->_getSubjectAlternativeNames();
     if ($san === false || !isset($san['uri'])) {
         return false;
     }
     $foafPublicKey = $instance->_getFoafRsaPublicKey($san['uri']);
     if ($foafPublicKey === false) {
         return array('certPublicKey' => $rsaPublicKey, 'webId' => $san['uri']);
     } else {
         return array('certPublicKey' => $rsaPublicKey, 'webId' => $san['uri'], 'foafPublicKey' => $foafPublicKey);
     }
 }