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:----F99wGSO4DemHhl8B2YxljNLr6pckrFw5L3PfLoeWnOW8tjPpbdkJzruFwM0kHtJ6eF240fMkPahx5cTGJIHulDrTZvZPxUs3VK6HVVDOly5Yoq3V5NEoMAomsmn0leNlGzexosPCqNaBKaqrcxvlUuuKxvHZqMORN3i6Sfw075ydJ3M7svEaLL1Mvtd1ay7NV9npbVizJzmf6XL94PIMLNMfBLNxQO6f0q0l4RnKuT3OiwqXC+k3WCbhfA9XsK80sni3W6ONQvc26XaKo9oqH6P3hbu9Zl7V9xXQ8Tvcgd7OttyAU0L4u6kRvFzl4CRntY9NTOJL0T9B9nHZAup+GgiK4hWq+NHPQLywS1h1n0FXq7om1UuCVDKMHA8SzzW9azHxILJbRvrtm//EamEDiuwces+bLaD+g4d3QU8V6A9nflXUYlozlz19SmS7TI1wyClTG+IEVRMEoqbX8vty1ySR8wF3hsQ4hDA55ImYW59mTk6vYJeqg5qgXpD58GgKFOGmtDC0DYdCPceYiYifNRB1+oAXCJuZfWLPoFeuCWp9WVse540/kNf5LwN6OfL7eLMWoczxEMWpYRaL3JG4l0A9Kax+eiNaqPb45XjwNuA082gyBXmr7b23+UYzFw2PtBLgxDSEjtjwpOM7Fxfwp9ts077wjmC2x9dwyzVKZ0c=----ATTACHMENT:----Nzg0Njk2MDA0MDIyMTY2NyA3NzUxODU1ODkzNzkwMDU2IDMxMDcwODI4MTIwNTI1OTM=