A browser with JavaScript enabled is required for this page to operate properly.
Trail: Security Features in Java SE
Lesson: Exchanging Files
Steps for the Contract Sender
Home Page > Security Features in Java SE > Exchanging Files

Steps for the Contract Sender

The steps outlined here for the contract sender are basically the same as those listed for a code signer in the Signing Code and Granting It Permissions lesson. Here, however, you are pretending to be Stan Smith rather than Susan Jones and are storing a data file rather than a class file in the JAR file to be signed.

The steps you take as the contract sender are as follows.

  1. Create a JAR File Containing the Contract, using the jar tool.

  2. Generate Keys (if they don't already exist), using the keytool -genkey command.

    Optional Step: Generate a certificate signing request (CSR) for the public key certificate, and import the response from the certification authority. For simplicity and since you are only pretending to be Stan Smith, this step is omitted. See Generating a Certificate Signing Request (CSR) for a Public Key Certificate for more information.

  3. Sign the JAR File, using the jarsigner tool and the private key generated in step 2.

  4. Export the Public Key Certificate, using the keytool -export command. Then supply the signed JAR file and the certificate to the receiver, Ruth.

Steps for the Contract Sender
This figure has been reduced to fit on the page.
Click the image to view it at its natural size.


Problems with the examples? Try Compiling and Running the Examples: FAQs.
Complaints? Compliments? Suggestions? Give us your feedback.

Previous page: Exchanging Files
Next page: Create a JAR File Containing the Contract