OpenSSH Private Key
How to open an OpenSSH private key file and read its content data to a buffer? There is no private key file extension. is there any way to verify that the selected file is a private key file? I am using the following method. But I am not sure that if there is any other method to open the private key file and read its contents? Thank you for your help in advance.
char * buffer;
long size;
ifstream file ("C:\Test\keyfile", ios::in|ios::binary|ios::ate);
if(file) {
size = file.tellg();
file.seekg (0, ios::beg);
buffer = new char [size];
file.read (buffer, size); file.close();
}
cout << "the complete file is in a buffer";
delete[] buffer;