Restructure signing code

All sorts of signatures can be verified now, and it is easier to extract
information from the verified signature packets.
This commit is contained in:
Stephen Paul Weber
2013-01-20 21:44:33 -05:00
parent f9ea5ee0e5
commit 4263d03188
6 changed files with 163 additions and 53 deletions

View File

@@ -10,7 +10,7 @@ class MessageVerification extends PHPUnit_Framework_TestCase {
$pkeyM = OpenPGP_Message::parse(file_get_contents(dirname(__FILE__) . '/data/' . $pkey));
$m = OpenPGP_Message::parse(file_get_contents(dirname(__FILE__) . '/data/' . $path));
$verify = new OpenPGP_Crypt_RSA($pkeyM);
$this->assertSame($verify->verify($m), TRUE);
$this->assertSame($verify->verify($m), $m->signatures());
}
public function testUncompressedOpsRSA() {
@@ -39,3 +39,16 @@ class MessageVerification extends PHPUnit_Framework_TestCase {
}
*/
}
class KeyVerification extends PHPUnit_Framework_TestCase {
public function oneKeyRSA($path) {
$m = OpenPGP_Message::parse(file_get_contents(dirname(__FILE__) . '/data/' . $path));
$verify = new OpenPGP_Crypt_RSA($m);
$this->assertSame($verify->verify($m), $m->signatures());
}
public function testHelloKey() {
$this->oneKeyRSA("helloKey.gpg");
}
}