
298 Chapter 7 • Securing Your Java Code
3. Finally, you can compare the signature against the message using
the public key.The algorithm for this also contained in the class
Signature.
Generating a Key Pair
Key pairs can be obtained over the Internet from many security compa-
nies, such as VeriSign or Thawte. In fact, most e-mail programs such as
Microsoft Outlook have options for digitally signing your mail to
authenticate messages sent by you. In the Options in Outlook, you can
click on a button that tells you how to obtain a digital ID from one of
many vendors (see Figure 7.15). By clicking on Digital IDs you can
also view a list of public keys you ...