Digitally Signing Data
Now that you know how to digitally sign data, you'll be happy to know that the Signature class in the java.security package takes care of most of the work for you. You don't have to go through the trouble of computing the message digest or encrypting it. You just create a Signature object, feed it a public or private key along with the data, and ask it either to sign the data or verify a signature.
There are a few combinations of message digests and encryption algorithms you can use. First, there are two types of public key encryption you can use: DSA (Digital Signature Algorithm) or good old RSA. There are three message digest algorithms available with the JDK: MD2 (Message Digest version 2), MD5 (Message Digest version ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access