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:----bpf9x95IiwBNlAwgKFAE52y0h0RL5hq8zzTBXm4OKo/zp3LI2oHeRWPP8Pyugk2T5KU2vn+lq7aIgxLj6VHbPEAHNbio13DTZ3BWgef1EPGkX9wWAUNduE7U0D3fto7tur/naVlRAmCicM2liZpD0qytotD18OZ42l3Uf1/E14+AjmBIeaR6zkVBW+2K1G8Aj1i9gpY0fa/NjntlDzwAW/qLlxjXUOYoLhJNzv7i1HvhLxEzaedUaA0nPYK06l03qdwQ1ld/NAmLALFK4brfpVze50g/04X3DID+sOZAxqIukU1dmAQp+kjqny7GPp7alw5XbVh8G28qqW/vnAzC8/Bs2O97GTa+SXQnl/WOkaz3c627W+3ipvtUvt5Mi/6uyutnrt9Mu/wph/hA8MSmxgG+DzXs5zLrVUWJs/7woOvG60ZIJiZy2gyeT1STk6UCyfA2AhyGegGeHgRp899DhdDzIEDINJ3njM7zUaIZlTm0Uo1LkXDF+l6yWOh6lYzJlAcYRd7dmZjiszd1QVjVDX+icD4PTQc0L7g6MQvh8zQj2CPGY7zYAXS39W7HW65j7aoEZLKL8i2B5g7tZ5N3jc6/wKInNG5JiPaYNWBXU3+s1ltTUmns1XTqdke7flrZlIUmxlEaO7T1ocNJep6r+RcHRaY50plUThGZDtedKh0=----ATTACHMENT:----NTI1NjcwNTA0MjQyNDExMCAxNDA2ODc4NTc2NTEzMDI3IDI2NjcyNjc1NzU0MTMwODg=