private void writeKeypair(final SECPPublicKey publicKey, final SECPPrivateKey privateKey)
      throws IOException {
    final Address nodeAddress = Util.publicKeyToAddress(publicKey);
    addressesForGenesisExtraData.add(nodeAddress);
    final Path nodeDirectoryPath = keysDirectory.resolve(nodeAddress.toString());
    Files.createDirectory(nodeDirectoryPath);
    createFileAndWrite(nodeDirectoryPath, publicKeyFileName, publicKey.toString());
    if (privateKey != null) {
      createFileAndWrite(nodeDirectoryPath, privateKeyFileName, privateKey.toString());
    }
  }
Writes public and private keys in separate files. Both are written in the same directory named
with the address derived from the public key.

@param publicKey The public key.
@param privateKey The private key. No file is created if privateKey is NULL.
@throws IOException If the file cannot be written or accessed.
app/src/main/java/org/hyperledger/besu/cli/subcommands/operator/GenerateBlockchainConfig.java