/** * @param Binary $key * @return Binary */ public function getAddress(Binary $key) { $math = MathAdapterFactory::getAdapter(); $inflatedPrivateKey = $this->deserializePrivate($key->getData(), $math); $publicKey = $inflatedPrivateKey->getPublicKey(); $publicSerializer = new DerPublicKeySerializer(); $serialized = $publicSerializer->serialize($publicKey); return new Binary($serialized); }
/** * @param Hasher $hasher * @param PublicKeyInterface $publicKey * @return OctetString */ private function keyIdentifier(Hasher $hasher, PublicKeyInterface $publicKey) { $binary = $this->pubKeySerializer->serialize($publicKey); $hash = $hasher->hash($binary); return new OctetString($hash); }