fixed crash in openssl private_key->get_public_key(), using encode/load workaround