TwoStepSignStep1.java 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. ///////////////////////////////////////////////////////////////////////////
  2. // Copyright (c) 2018 Intel Corporation. //
  3. // //
  4. // All rights reserved. This program and the accompanying materials //
  5. // are made available under the terms of the Eclipse Public License v1.0 //
  6. // which accompanies this distribution, and is available at //
  7. // http://www.eclipse.org/legal/epl-v10.html //
  8. // //
  9. // Contributors: //
  10. // Intel Corporation - initial implementation and documentation //
  11. ///////////////////////////////////////////////////////////////////////////
  12. package com.intel.sgx.handlers;
  13. import org.eclipse.jface.dialogs.InputDialog;
  14. import com.intel.sgx.dialogs.SGXDialogBase;
  15. import com.intel.sgx.dialogs.TwoStepSignStep1Dialog1;
  16. import com.intel.sgx.dialogs.TwoStepSignStep1Dialog2;
  17. import com.intel.sgx.dialogs.TwoStepSignStep1Dialog3;
  18. // Generate Hash
  19. public class TwoStepSignStep1 extends TwoStepSignHandlerBase {
  20. public TwoStepSignStep1() {
  21. }
  22. @Override
  23. protected Object executeSGXStuff() throws ErrorException, CancelException {
  24. initializeSigntool();
  25. showDialog1();
  26. showDialog2();
  27. showDialog3();
  28. return null;
  29. }
  30. private void showDialog1() throws CancelException, ErrorException {
  31. TwoStepSignStep1Dialog1 dialog1 = new TwoStepSignStep1Dialog1(shell, this);
  32. if (dialog1.open() != InputDialog.OK) {
  33. cancel();
  34. }
  35. executeGenData();
  36. }
  37. private void showDialog2() throws CancelException {
  38. TwoStepSignStep1Dialog2 dialog2 = new TwoStepSignStep1Dialog2(shell,
  39. hashFile);
  40. if (dialog2.open() != InputDialog.OK) {
  41. cancel();
  42. }
  43. }
  44. protected void showDialog3() throws CancelException, ErrorException {
  45. SGXDialogBase dialog3 = new TwoStepSignStep1Dialog3(shell, this);
  46. if (dialog3.open() != InputDialog.OK) {
  47. cancel();
  48. }
  49. validateExternalSignPublicKeyFile();
  50. validateExternallySignedHashFile();
  51. executeCatSig();
  52. }
  53. }