public function generateKeyPair() : KeyPair
    {
        $generator = EccFactory::getNistCurves()->generator256();

        $eccPrivateKey = $generator->createPrivateKey();
        $privateKey = PrivateKey::createFromEccKey($eccPrivateKey);

        return new KeyPair($privateKey, $privateKey->getPublicKey());
    }