Developers
Local Navigation
Exercise
Build an application that uses advanced features in the Cryptography API such as encryption, decryption, signing and verification using public key cryptography.
Prerequisite: You should have completed the lab entitled Basic encryption and decryption before starting this exercise.
Objectives
- Discover how to use a PublicKey for encryption.
- Discover how to use a PrivateKey for signing.
- Discover how to use a PrivateKey for decryption.
- Discover how to use a PublicKey for verification.
Setup
- Download the file (ZIP)
- In the IDE, open the AdvancedCryptoDeveloperLab.jdw workspace
- Open the AdvancedCryptoDeveloperLab.java source file.
Tasks
- Complete the implementation of the encrypt method:
- Implement the encrypt method using the RSAPublicKey.
- Implement the sign method using the RSAPrivateKey.
- Implement the decrypt method using the RSAPrivateKey.
- Implement the verify method using the RSAPublicKey.
Note: You are required to import the net_rim_crypto.jar file into your project to access the Cryptography API.
Check Your Work
Download the completed code (ZIP)
Review
In this exercise, you discovered the following things:
- to use a PublicKey for encryption and for verification.
- to use a PrivateKey for signing and for decryption.