generate(); // then create a PublicKey Object $publicKey = new PublicKey(KEY_DIR . PUBLIC_KEY_NAME); // inject the private key into the public key $publicKey->setPrivateKey($privateKey); // generate the public key $publicKey->generate(); /** * NOTE: You can again do all of this with one line of code like so: * $publicKey = \BTCPayServer\PublicKey::create(KEY_DIR . PUBLIC_KEY_NAME)->setPrivateKey($privateKey)->generate(); */ /** * Now that you have a private and public key generated, you will need to store * them somewhere. This option is up to you and how you store them is up to * you. Please be aware that you MUST store the private key with some type * of security. If the private key is compromised you will need to repeat this * process. */ /** * It's recommended that you use the EncryptedFilesystemStorage engine to persist your * keys. You can, of course, create your own as long as it implements the StorageInterface */ $storageEngine = new EncryptedFilesystemStorage(PASSWORD); $storageEngine->persist($privateKey); $storageEngine->persist($publicKey); /** * This is all for the first tutorial, you can run this script from the command * line `php examples/tutorial/001.php` This will generate and create two files * located at `/tmp/btcpay.pri` and `/tmp/btcpay.pub` */