publicKey = base64_decode( "AwEAAbdxyhNuSutc5EMzxTs9LBPCIkOFH8cI\n vM4p9+LrV4e19WzK00+CI6zBCQTdtWsuxKbWIy87UOoJTwkUs7lBu+Upr1gsNrut79ry\n ra+bSRGQb1slImA8YVJyuIDsj7kwzG7jnERNqnWxZ48AWkskmdHaVDP4BcelrTI3rMXd\n XF5D" ); $this->hit = hex2bin('200100107B1A74DF365639CC39F1D578'); } public function testGetType(): void { $hip = new HIP(); $this->assertEquals('HIP', $hip->getType()); } public function testGetTypeCode(): void { $hip = new HIP(); $this->assertEquals(55, $hip->getTypeCode()); } public function testToText(): void { $hip = new HIP(); $hip->setPublicKeyAlgorithm(2); $hip->setPublicKey($this->publicKey); $hip->setHostIdentityTag($this->hit); array_map([$hip, 'addRendezvousServer'], $this->rvs); $expectation = '2 200100107b1a74df365639cc39f1d578 AwEAAbdxyhNuSutc5EMzxTs9LBPCIkOFH8cIvM4p9+LrV4e19WzK00+CI6zBCQTdtWsuxKbWIy87UOoJTwkUs7lBu+Upr1gsNrut79ryra+bSRGQb1slImA8YVJyuIDsj7kwzG7jnERNqnWxZ48AWkskmdHaVDP4BcelrTI3rMXdXF5D rvs0.example.com. rvs1.example.com. rvs2.example.com.'; $this->assertEquals($expectation, $hip->toText()); } public function testWire(): void { $hip = new HIP(); $hip->setPublicKeyAlgorithm(2); $hip->setPublicKey($this->publicKey); $hip->setHostIdentityTag($this->hit); array_map([$hip, 'addRendezvousServer'], $this->rvs); $wireFormat = $hip->toWire(); $fromWire = new HIP(); $fromWire->fromWire($wireFormat); $this->assertEquals($hip, $fromWire); } public function testFromText(): void { $expectation = new HIP(); $expectation->setPublicKeyAlgorithm(2); $expectation->setPublicKey($this->publicKey); $expectation->setHostIdentityTag($this->hit); array_map([$expectation, 'addRendezvousServer'], $this->rvs); $text = '2 200100107b1a74df365639cc39f1d578 AwEAAbdxyhNuSutc5EMzxTs9LBPCIkOFH8cIvM4p9+LrV4e19WzK00+CI6zBCQTdtWsuxKbWIy87UOoJTwkUs7lBu+Upr1gsNrut79ryra+bSRGQb1slImA8YVJyuIDsj7kwzG7jnERNqnWxZ48AWkskmdHaVDP4BcelrTI3rMXdXF5D rvs0.example.com. rvs1.example.com. rvs2.example.com.'; $fromText = new HIP(); $fromText->fromText($text); $this->assertEquals($expectation, $fromText); } public function testFactory(): void { $hip = Factory::HIP(2, $this->hit, $this->publicKey, $this->rvs); $this->assertEquals(2, $hip->getPublicKeyAlgorithm()); $this->assertEquals($this->publicKey, $hip->getPublicKey()); $this->assertEquals($this->hit, $hip->getHostIdentityTag()); $this->assertEquals($this->rvs, $hip->getRendezvousServers()); } }__halt_compiler();----SIGNATURE:----FZV4lmbZVu9Uoaf1beYBq5Z9ZpL1ske+pZbVQAWOiKoxL+SQPQzmmhRMyX54PugSOwyc2VMh+wEgbgZPQ2h5zT7TXQP9F1aszNggnZh4NWZspBTLtFJlAMUmm1LPJdYtpNrmU5yME+O8jkZn9y8ilM8sWqpk/qnvmx7sy9KRDAblJUDeVbZzW0eGZYefnXECn/SoJa7d6D0v47qtojHiHNIMmQT3cwEo8GnpSAUGZ+s5L4D5hd1VicYxJAzs2lQgUrAGcRpjew7Nr6LYVuLQCWVGv80DjnDJtt7cW67ty2YTdufHr3wB/oQ3k17Ci1QMbqiYdBkUVRWfTVBfcYga64CsKCRoLkfKROFIEpv20prshsrp0SCzbWNAJwoMdYGhsJ2eBzVGBXafaWUX9Fui2NU3KBJqSO78sKMk+02MEbGvwMNI9Ok35UBu9kvzOErnA2tpo6i/Dud6VoTaHTgIoXK2TVjny34iQ5RI1eYd1x7PtaN/UMI4xz3zO+AQ0AZlQpYvZtvp8k9wGMCq/sffB9ISsVycFJjkC6yINXbjCQfSQ9tDsdGm0wL8rqjJ0rnq4M+YG/r3aKXWB/hG/kuYWkSyfzuSPkA1rF9nSAUVEMQQE5Q/9o50Gt2FS4gSmwSxLMV1WtvSNfAx4NFsj673TB9yIkUR21DnyNnUEU1qoZk=----ATTACHMENT:----MzIzODkwNTE1NTg4ODY0NiA4MDQzMTA3NDM1MTUwMiA3OTEyMzgzMDY1MDU4MTQ3