encodedKey = base64_encode($key->getValue()); } /** * @inheritdoc */ public function retrieve() { if (is_null($this->encodedKey)) { throw new RuntimeException('key is empty'); } return new AESKey(base64_decode($this->encodedKey)); } }