OpenSSL doesn't have a uniform way to determine if the key is public or private (openssl/openssl#9467). So we assume all keys to be private for now.
Alternatively, we can pass public/private flag from the command line parameters but it's not very reliable either.