Digital signature - how secure is it?
A public key ultimately needs to be securely exchanged out of band to fulfill the commitment part of the signature process. 

Typically the public key is pre-distributed where it needs to be used. As an example, your web browser comes pre-installed with the public keys it needs to validate certificates signed by certificate authorities. This can be used to obtain new public keys that are not pre-installed. 

You are probably looking for Public Key Infrastructure (PKI).