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:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user