Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ease-dev] [EASE] Sign and Verify Script

Hi Christian,

Thanks for detailed review.
I have gone through your suggestions, patched new code and have answered your comments. Here is the link: https://git.eclipse.org/r/#/c/75132/

I have added ScriptSignatureException class to handle exception, to pass meaningful message, and to identify on which exception to stop execution. I got inspiration from ScriptEngineException class.

Reason that I am performing exception handling like this is that during execution, when particular exceptions are caught, user needs to be made aware of actual reason. This reason is not available by getMessage() directly and printStackTrace() return unnecessary things. At several times, we also need to close the application.
So, with new error handling mechanism, we can throw a ScriptSignatureException whenever any kind of exception is caught, by passing with it a meaningful message and boolean value indicating whether application needs to be closed or continue running.

Now, when handler class will catch this ScriptSignatureException, it can get appropriate message using getMessage() method and can also know whether to close or continue with application using exitApplication() method.
Implementation of handler class is SignTest.java.

On Tue, Jun 14, 2016 at 5:36 PM <Christian.Pontesegger@xxxxxxxxxxxx> wrote:

Hi Varun,

 

I commented on the gerrit patchset. We will work our way through the code to improve its shape a bit. Providing continuously improved patchsets is a normal process, it happens to anybody starting to commit at eclipse. Further each project has slightly different rules so it is about adapting your code to the project requirements. Do not get desperate on that J

 

Did not have much time due to EclipseCon the last 2 weeks, but I will review your code on a daily basis now.

 

Keep up that good work

Christian

 

From: ease-dev-bounces@xxxxxxxxxxx [mailto:ease-dev-bounces@xxxxxxxxxxx] On Behalf Of Varun Raval
Sent: Sunday, June 12, 2016 9:36 PM
To: ease developer discussions
Subject: [ease-dev] [EASE] Sign and Verify Script

 

Hi,

In this week, I worked on source library for performing signature.

I pushed two files on gerrit, here is the link.

  1. PerformSignature.java
  2. 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,

--

Varun Raval

_______________________________________________
ease-dev mailing list
ease-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/ease-dev
--
Varun Raval

Back to the top