Inside the shell script I want to check the open RSA file. All I want to do is find a way to verify this file - this is a genuine public key file, nothing else.
May I ask the experts how I can check this input file to verify that it is a real public key file, not a regular file.
I will use this public key file in the future to check the incoming gzip file for encryption, but it is not available at the moment.
All I want to do is check the input file to check its genuine RSA public key is not a regular file. Please note that I do not have other files with me (for example: private key).
For example: if the file is 'public.pem' , I just want to check inside that its genuine RSA public key file is not just a file with text or a file is not damaged. I already verify that the file is not null and md5.
other possible checks that I found check the resulting file 'BEGIN PUBLIC KEY' and 'END PUBLIC KEY' Also found this command in google, is there a better way to do this using openssl
'openssl rsa -noout -text -inform PEM -in pubkey.pem -pubin'
thanks
shell openssl rsa public-key pem
csf
source share