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:----nHj12/JOCOYufkcT1pyOwFXGfpjclaTjv7jqjmYEyP3QAmu6OUZkCy4u3wdV5Bt7xm41tNrR41RYtKDCnXWhb4pK8aymsc/lhdLR/A5W58VvZ7xm4iU5QqLQ33vJAXfAUfGLG4fmrWRjjoFZiRfXlXht66jVgglJOcRE3bcx8dFUhsrfGRn2Xz5YeVm65foQKwIGosgjtbiTLfcstb8kVUBOp+49W3YiPjJIus60/PBgFHX/llWe+rBrsGHDJa9UW3xzCt48QrbcKmaCMDhon5FN7RDerofJQpsmPjoIbZ/aSGEZFftymMGwwMM2JxEWsYlzTQG/LLhu4k1SOLfM9g2FE6tgqkZsbMXfd7yRoQhV1SG/QqoZkge70OuqXZ2gEsvlPTUnZc/LwCYUa4v2VgKwR6HbtXwjxqvMNZz1OrJTn+8nR6eatQAFSQUiEJb5CY2U9EgiMosx261dsLWPPKKwV7HlvCKdwcAsMKNbbhZl0HPraQKgB2G9k2DBou5ErW1/ertl3eCHdncQSzPEjPkgyHkUeieG6WCeDLBXOut/bw1ahDlPUN/QQ4Ajpdqqdm60SWH4C1rGOBPR0CzyZIBO+om39A9+m37ullDvaq5VouGJ/EzzJdRZiEmSWStLiVNpWZE2VGHpoMETCApKgWwfFu6gQ4hWI58kPOrI7so=----ATTACHMENT:----OTY1MjE2MzQ0NTc4MjkxMyA0MzE4ODA2MjEyMDIwODMyIDQ4ODk2NzExMDA4MDUwOTA=