Exemplo n.º 1
0
 /**
  * Verify signature of given message
  * 
  * @param string $string
  * @return boolean
  */
 public static function verify($string)
 {
     $gpg = new Crypt_GPG();
     $signatures = $gpg->verify($string);
     if ($signatures[0]->isValid()) {
         return true;
     } else {
         return false;
     }
 }
Exemplo n.º 2
0
 /**
  * Verify signature of given message
  * 
  * @param string $string
  * @return boolean
  */
 public static function verify($string)
 {
     $homeDir = ConfigManager::getConfig("Crypto", "GPG")->AuxConfig->gpgHomeDir;
     $gpg = new Crypt_GPG(array('homedir' => $homeDir));
     $signatures = $gpg->verify($string);
     if ($signatures[0]->isValid()) {
         return true;
     } else {
         return false;
     }
 }
Exemplo n.º 3
0
 /**
  * Verify a message
  *
  * @param Message $message
  * @param string $fingerprint
  * @return bool
  * @throws \Exception
  */
 public function verify(Message $message, string $fingerprint) : bool
 {
     $gnupg = new \Crypt_GPG($this->options);
     $gnupg->addSignKey($fingerprint);
     /**
      * @var \Crypt_GPG_Signature[]
      */
     $verified = $gnupg->verify($message->getBodyText());
     foreach ($verified as $sig) {
         if (false) {
             $sig = new \Crypt_GPG_Signature();
         }
         if ($sig->isValid()) {
             return true;
         }
     }
     return false;
 }
Exemplo n.º 4
0
function verify_file($filedata, $signature)
{
    $gpg = new Crypt_GPG();
    $results = $gpg->verify($signature);
    return $results;
}