O'Reilly logo

Special Edition Using Java™ 2 Enterprise Edition by Mark Wutka

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required