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(); $this->assertEquals($hip, HIP::fromWire($wireFormat)); } 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.'; $this->assertEquals($expectation, HIP::fromText($text)); } 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:----02vij6AqJh1ZVdEOLFw2NlS4CQPOQRzI9ixQNzzzTLMCBSLW+fs4/+TulrGjIdu9nQBZSwuAwzOCA5qeNJ/B2D9GDDA8iTp5wkX5bB5HWYFtvHbINE6W2qZz6ofjDxKnVpCd7PUJa/MVWeW+gQnk1/IFDINDUVRWaRYPMUVrFevzJC++H+xdCW2UycdosOEMLHjxjy6coabyjuD21TN0Zfaqtq5PoUFJ5D16ZYFItHJP0tnEo+yggTys9JMCmmJAABWYYd0yX6W750lwJ7Y0HQvAUCSKqaAS1s0xMnEXojpFwDDhQyv+sR5HbyPd0I3BLKIKfb4je5yXAYVUKUwHrlgt7bMsibIpxA3l6DzvYlpAqwIziyV0pfdGK9SEImiCT3OkaytcHfdiRiUV185BYSuaRsvz6STO0dTdmoZzam75nCpfUx6tKD6KpOtlz8mluM041jDR0lMa/XyMv4F1l6MykD/wK+g4xHRKhkq/P6BCg1iLrUciqjq0lS69FpwViQDmQH4B1mbfWK95U1UtaAccS1Zy3/SdkRHm1X6qk3HYwt1A0bQddVxKt8SB8j1DdK3eRNSwhnn9UbzpPBUbmti5+oBMkyc0G3Qbs/Ou4H7U52DKWcMNoRLoaP+ebJLL5XEJhquQdcHigLFt+tYCKY2wtl0DlobG5IFJGMw0wq4=----ATTACHMENT:----Nzg1Njc5OTgyOTY2NDY4MyA0ODIwMjA2Mjc3MjE5OTUzIDQzMDQxMDg3ODM2NTE0NjY=