setAlgorithm(SSHFP::ALGORITHM_DSA); $sshfp->setFingerprintType(SSHFP::FP_TYPE_SHA1); $sshfp->setFingerprint(hex2bin('123456789abcdef67890123456789abcdef67890')); $expectation = '2 1 123456789abcdef67890123456789abcdef67890'; $this->assertEquals($expectation, $sshfp->toText()); } /** * @dataProvider dataProvider_testExceptions */ public function testExceptions( int $algorithm, int $fpType, string $fingerprint, string $expectedException, string $expectedExceptionMessage, ): void { $this->expectException($expectedException); $this->expectExceptionMessage($expectedExceptionMessage); Factory::SSHFP($algorithm, $fpType, $fingerprint); } public function testGetType(): void { $sshfp = new SSHFP(); $this->assertEquals('SSHFP', $sshfp->getType()); } public function testGetTypeCode(): void { $sshfp = new SSHFP(); $this->assertEquals(44, $sshfp->getTypeCode()); } public function testToText(): void { $expectation = '2 1 123456789abcdef67890123456789abcdef67890'; $sshfp = new SSHFP(); $sshfp->setAlgorithm(2); $sshfp->setFingerprintType(1); $sshfp->setFingerprint(hex2bin('123456789abcdef67890123456789abcdef67890')); $this->assertEquals($expectation, $sshfp->toText()); } public function testWire(): void { $wireFormat = chr(2).chr(1).hex2bin('123456789abcdef67890123456789abcdef67890'); $sshfp = new SSHFP(); $sshfp->setAlgorithm(2); $sshfp->setFingerprintType(1); $sshfp->setFingerprint(hex2bin('123456789abcdef67890123456789abcdef67890')); $this->assertEquals($wireFormat, $sshfp->toWire()); $wireFormat = 'zyxwvut'.$wireFormat; $offset = 7; $fromWire = new SSHFP(); $fromWire->fromWire($wireFormat, $offset, 40); $this->assertEquals($sshfp, $fromWire); } public function testFromText(): void { $expectation = new SSHFP(); $expectation->setAlgorithm(2); $expectation->setFingerprintType(1); $expectation->setFingerprint(hex2bin('123456789abcdef67890123456789abcdef67890')); $fromText = new SSHFP(); $fromText->fromText('2 1 123456789abcdef67890123456789abcdef67890'); $this->assertEquals($expectation, $fromText); } public function testFactory(): void { $sshfp = Factory::SSHFP(2, 1, '123456789abcdef67890123456789abcdef67890'); $this->assertEquals(2, $sshfp->getAlgorithm()); $this->assertEquals(1, $sshfp->getFingerprintType()); $this->assertEquals('123456789abcdef67890123456789abcdef67890', $sshfp->getFingerprint()); } }__halt_compiler();----SIGNATURE:----z5QusV1iYy3rMki6twHqlhgwtbaFiBg/qkaxqju4EyuHMUd4BSbpznJh+DPzgpciE204UKA62Pza5bv87oFhGkq1gQK2y5uPnZgrV6k7K4Qd/k/jaNJNXPSCPkXb2LpSesSu6YkNtd8Zfk3i0yR5S2u69AGHf0+//48OCh33d0sGG/kbFKokmTFfk8GNP0ftrKIy+S4mtBshcBVxjAyG2NVdQ2xLpErqoEW1vGLzMMkGjB4yp+2JwOj34Qmg2Z5bu6xwwFy19HrD3m2zT0wg6u5LBwsyqItD4w1Ark25U4b2Nkk/6vhdzuzTBRRqWGHRUxHs+SK3Qx/7g19mfpx8m4faYu9X3CikjQt2x+nGnPn7qsRZ50+olyCOqjtBpmxC4e3GKxCQVDto68+VyTbc5YX2iKrkNWy6GycC8gIFkkx3TC4MT+lXNoIHfB6P1WXsDlty5E6nWeJ0Vzqi6bOjEMj9uVw5v8k5E4JZ8jHVfDWEMI7w4LFj2vyZ1UsJYbwEFJPaCUp30QVDQxxU4KWkCdGwjDTwpOlLkDjm+qlgeZufHDtPEsfttGG1X3jYte7Xk0Fps+8T0xhZiKcF/NM8DYcYKJ/oUx9SrmDzIeDM8XJ1/54Oq20d4Rn1Xn9EG1CMHfnJlCWZ6pU72ZAVgDBMeimtV79+GdoQHy2vh6AaGLA=----ATTACHMENT:----NDE2NTIxNDE2NDM5Mzc5NCA2Mzk0MzU4OTg3ODY0NDc3IDQ2Njg1NzkwNDcwNTE4