How to use a public key and private key in digital signatures