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:
BIN
tests/data/helloKey.gpg
Normal file
BIN
tests/data/helloKey.gpg
Normal file
Binary file not shown.
@@ -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");
|
||||
}
|
||||
}
|
||||
|
@@ -378,15 +378,15 @@ class Fingerprint extends PHPUnit_Framework_TestCase {
|
||||
$this->oneFingerprint("000001-006.public_key", "421F28FEAAD222F856C8FFD5D4D54EA16F87040E");
|
||||
}
|
||||
|
||||
public function test000016006public_key() {
|
||||
$this->oneFingerprint("000016-006.public_key", "AF95E4D7BAC521EE9740BED75E9F1523413262DC");
|
||||
}
|
||||
public function test000016006public_key() {
|
||||
$this->oneFingerprint("000016-006.public_key", "AF95E4D7BAC521EE9740BED75E9F1523413262DC");
|
||||
}
|
||||
|
||||
public function test000027006public_key() {
|
||||
$this->oneFingerprint("000027-006.public_key", "1EB20B2F5A5CC3BEAFD6E5CB7732CF988A63EA86");
|
||||
}
|
||||
public function test000027006public_key() {
|
||||
$this->oneFingerprint("000027-006.public_key", "1EB20B2F5A5CC3BEAFD6E5CB7732CF988A63EA86");
|
||||
}
|
||||
|
||||
public function test000035006public_key() {
|
||||
$this->oneFingerprint("000035-006.public_key", "CB7933459F59C70DF1C3FBEEDEDC3ECF689AF56D");
|
||||
}
|
||||
public function test000035006public_key() {
|
||||
$this->oneFingerprint("000035-006.public_key", "CB7933459F59C70DF1C3FBEEDEDC3ECF689AF56D");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user