You may need to export a public key from the private key, because the public key provided by the key generated by other tools is in pem format, and we need openssh format
```
<?php
$public = openssl_pkey_get_details(openssl_pkey_get_private(OPENSSL_USER_PRIVATE_KYE))['key'];
// save $public
```