Message signature verification tests
This commit is contained in:
Binary file not shown.
Binary file not shown.
41
tests/phpseclib_suite.php
Normal file
41
tests/phpseclib_suite.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
/* The tests which require phpseclib */
|
||||
|
||||
require_once dirname(__FILE__).'/../lib/openpgp.php';
|
||||
require_once dirname(__FILE__).'/../lib/openpgp_crypt_rsa.php';
|
||||
|
||||
class MessageVerification extends PHPUnit_Framework_TestCase {
|
||||
public function oneMessageRSA($pkey, $path) {
|
||||
$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);
|
||||
}
|
||||
|
||||
public function testUncompressedOpsRSA() {
|
||||
$this->oneMessageRSA('pubring.gpg', 'uncompressed-ops-rsa.gpg');
|
||||
}
|
||||
|
||||
public function testCompressedSig() {
|
||||
$this->oneMessageRSA('pubring.gpg', 'compressedsig.gpg');
|
||||
}
|
||||
|
||||
public function testCompressedSigZLIB() {
|
||||
$this->oneMessageRSA('pubring.gpg', 'compressedsig-zlib.gpg');
|
||||
}
|
||||
|
||||
public function testCompressedSigBzip2() {
|
||||
$this->oneMessageRSA('pubring.gpg', 'compressedsig-bzip2.gpg');
|
||||
}
|
||||
|
||||
/*
|
||||
public function testUncompressedOpsDSA() {
|
||||
$this->oneMessageDSA('pubring.gpg', 'uncompressed-ops-dsa.gpg');
|
||||
}
|
||||
|
||||
public function testUncompressedOpsDSAsha384() {
|
||||
$this->oneMessageDSA('pubring.gpg', 'uncompressed-ops-dsa-sha384.gpg');
|
||||
}
|
||||
*/
|
||||
}
|
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
require dirname(__FILE__).'/../lib/openpgp.php';
|
||||
require_once dirname(__FILE__).'/../lib/openpgp.php';
|
||||
|
||||
class Serialization extends PHPUnit_Framework_TestCase {
|
||||
public function oneSerialization($path) {
|
||||
|
Reference in New Issue
Block a user