We will be using Java support for managing and working with digital certificates and key pairs.
"keytool" is a key and certificate management utility. It enables users to create and manage their own public/private key pairs and certificates for use in self-authentication and for encrypting and authenticating data. You are expected to do the following:
Examine the keytool tool from Java (link), and how it works. Use the tool to generate a certificate with public and private keys. Make sure you put your full name as the "common name" of the certificate, and your student ID as the "organization unit".. Use "DSA 1024-bit algorithm" for generating the keys.
import my certificate (link) into the keytool.
Write Java code to retrieve my public key and the private key from the keystore you created in (1). Use these keys to (1) encrypt this file (link) using my public key (RSA-2048 bit) then (2) digitally sign the result using sha1DSA signature algorithm. Save the digital signature output on a file called "[url removed, login to view]".
Export your certificate to Microsoft .cer format.
You should handle input and output files as a series of bytes.
This is sample code (link) for accessing the Keystore from Java.
To simplify things, use the Java "Signature" class.
You may use a different programming language than Java and a different crypto library, but you are expected to submit the same results as above. Make sure you mention the tools you used in your submission.
Here are instructions (link) to help you deal with RSA 2048 in Java.
In the default way the RSA is used, a 2048-key will allow you to encrypt 245 bytes. To encrypt the given file, you can divide the file into chunks each 245 bytes and encrypt each, or apply the "data envelope technique", just make sure you document what you used in the Readme file.
note : I want it in 4 hour