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

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

        return new KeyPair($privateKey, $privateKey->getPublicKey());
    }
public function generateKeyPair() : KeyPair
    {
        $generator = EccFactory::getNistCurves()->generator256();

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

        return new KeyPair($privateKey, $privateKey->getPublicKey());
    }
public function generateKeyPair ( ) : KeyPair { $ generator = EccFactory :: getNistCurves ( ) -> generator256 ( ) ; $ eccPrivateKey = $ generator -> createPrivateKey ( ) ; $ privateKey = PrivateKey :: createFromEccKey ( $ eccPrivateKey ) ; return new KeyPair ( $ privateKey , $ privateKey -> getPublicKey ( ) ) ; }
Generate a KeyPair.

@return KeyPair
Generate a KeyPair .