Assume that I want to sign digitally updates for an offline appliance (lets say a limited linux VM). To begin with, such mechanism is not in place and the very limited OS doesn't have any CA certificates. Secondly, any update can be uploaded only with removable media, so no Internet connection.
This scenario creates an already unsafe state, that I want to upgrade to a safer state. In this case I want to verify and authenticate my code to the appliance. We can assume that a certificate is not necessary (or maybe not?), since to begin with there is no a CA established (and not accessible in any method), and we proceed with just a classic RSA pair key signing process.
The first problem I see is the first update that will provide the public key to the appliance. Since we start from an unsafe state, I suppose we cannot resolve this. We have to accept that the first update might be malicious. But from that point on, each update could be verified by the public key.
The main problem is how to maintain such an approach. If for some reason the appliance looses its public key, is there a way to provide the public key with some confidence that the process is safe even if there is a cost in user experiece? For example if I provide the public key in an https site with its hash, and perhaps with a login process, could this resolve this edge case, as long as I trust the https connection? In this case I still used removable media, I just download the update (or the public key) from an other system and require some manual work from the user.
Is there a better approach that I might want dig into, to provide a better scheme with these conditions