Hi,
In this week, I worked on source library for performing signature.
I pushed two files on gerrit,
here is the link.
- PerformSignature.java
- HelperClass.java
As name suggests, PerformSignature.java contains core methods for performing signature. These methods are divided as per their functionality so that they can be best integrated with UI and it's easy to handle them. Sequence of tasks performed by these methods are as follows:
- to check user provided keystore file exists, and keystore with user provided settings is available
- load keystore using keystore password
- list aliases and check alias provided by user that it contain valid Private key and corresponding certificate is in proper format to load and can be loaded, using appropriate provider
- get signature in bytes format, convert bytes to Base64 format in form of string
HelperClass.java contains helper methods like appending signature to file and managing constants for handling errors.
To show how to use these methods, use SignTest.java. It shows how to integrate UI with core methods. For now, I have written code for user interaction using console which is in UserInteract.java. Place all four files in package org.eclipse.ease.sign and run SignTest.java.
What if a file already contains signature and user wants to update the signature? I am working on this. It looks simple: to check whether signature exists, and then to update just signature.
I am also working on code to verify signature.
To see how to use keytool utility for performing key management, see HOWTO.md.
Thanks,