Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Advanced features of the Cryptography API

by Retired ‎02-12-2010 01:11 PM - edited ‎09-17-2010 04:25 PM (2,526 Views)

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

  1. Open AdvancedCryptoDeveloperLab_1.zip
  2. In the IDE, open the AdvancedCryptoDeveloperLab.jdw workspace
  3. Open the AdvancedCryptoDeveloperLab.java source file.

Tasks

  1. Complete the implementation of the encrypt method:
  1. Implement the encrypt method using the RSAPublicKey.
  2. Implement the sign method using the RSAPrivateKey.
  3. Implement the decrypt method using the RSAPrivateKey.
  4. 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

 

Check AdvancedCryptoDeveloperLab_2.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.
Contributors
Users Online
Currently online: 17 members 582 guests
Please welcome our newest community members: