You can use puttygen.exe to create a key pair and store both the public key and private key locally.
Key pairs created using puttygen.exe must be imported by referring to Importing a Key Pair before they are used.
https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
PuTTYgen is a key generator, which is used to create a key pair that consists of a public key and a private key for PuTTY.
The key generator automatically generates a key pair that consists of a public key and a private key. The content shown in the red box in Figure 2 is the public key.
Do not save the public key by clicking Save public key because this operation will change the format of the public key content and cause the public key to fail to be imported to the management console.
The format in which to save your private key file varies depending on application scenarios.
If you use this private file to obtain the password for logging in to a Windows ECS, do not specify Key passphrase for Export OpenSSH key so that you can obtain the password successfully.