Parse pem file and allocate enough size for pubkey.