To set up a digital signature in Java, you first need to set up a private key, usually by using keytool or the security API methods. Programmers often use the Java Certificate feature to securely verify public key authenticity. . . .
To set up a digital signature in Java, you first need to set up a private key, usually by using keytool or the security API methods. Programmers often use the Java Certificate feature to securely verify public key authenticity. After you have a public key, you generate a digital signature using the jarsigner tool or the API methods. Use the Signature class to sign the data by creating the signature object, initialize it for signing, processing the data, and then sign it. After it's signed, you export the objects into files for shipping to the receiver.

Once the data is signed, you send the receiver the data and signature. You must supply the receiver with the public key corresponding to the private key you used to generate the signature. The receiver imports the public key then uses the key to verify integrity. The receiver can verify by grabbing the object, initializing it for verification, processing the data, and then comparing the signature.

The link for this article located at EarthWeb is no longer available.