Search code examples
sslx509certificatesignpublic-key

How to sign a message with my https public key certificate?


I just got myself an ssl certificate for my domain and it works fine, but I'm using the bitcoin payment protocol and I need to sign the messages with my public key before sending them but how are messages signed with an ssl certificate and what tools should I use?

EDIT

It seems what I actually need to do is sign a message using the public key of my ssl certificate issuer.

Thanks in advance :)


Solution

  • The protocol specification must be incorrect. Digital signatures are signed with your private key.

    Your certificate needs to accompany the message, and probably be included in the signature. Use the java.security.Signature class in association with your private key, possibly loaded from your KeyStore.

    You may need to purchase a signing certificate: an SSL certificate may not be strong enough for bitcoin.

    A signature using a public key is completely worthless. Anyone can do it. You sign with your private key. This is legally equivalent to your signature: only you can do it, and anyone can check it by verifying it with your public key, which is why the public key must accompany the signature; and at the same time they can establish whose signature it is, via the certificate which must also accompany the signature.

    Or else bitcoin is radically insecure.