TwoStepSignStep2Dialog.java 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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.dialogs;
  13. import org.eclipse.swt.layout.GridLayout;
  14. import org.eclipse.swt.widgets.Composite;
  15. import org.eclipse.swt.widgets.Control;
  16. import org.eclipse.swt.widgets.Shell;
  17. import com.intel.sgx.handlers.TwoStepSignHandlerBase;
  18. import com.intel.sgx.handlers.TwoStepSignStep2;
  19. public class TwoStepSignStep2Dialog extends TwoStepSignDialogBase{
  20. final private TwoStepSignHandlerBase handler;
  21. public TwoStepSignStep2Dialog(Shell parentShell, TwoStepSignHandlerBase handler) {
  22. super(parentShell);
  23. this.handler = handler;
  24. }
  25. @Override
  26. protected Control createDialogArea(Composite parent) {
  27. Composite composite = (Composite) super.createDialogArea(parent);
  28. final GridLayout gridLayout = new GridLayout(1,false);
  29. composite.setLayout(gridLayout);
  30. enclaveFileField= addGroup(composite, "Enclave:",
  31. "Select the unsigned enclave file",
  32. "Unsigned Enclave File:", "Select", enclaveFileSelectionListener);
  33. configFileField = addGroup(composite, "Configuration File:",
  34. "Select Input Configuration XML File. ",
  35. "Configuration File:", "Select Config",
  36. configFileSelectionListener);
  37. hashFileField= addGroup(composite, "Hash:",
  38. "Select the Hash file obtained from previous step",
  39. "Hash File:", "Select", hashFileSelectionListener);
  40. externalSignPublicKeyFileField= addGroup(composite, "Public Key:",
  41. "Select the Public Key file obtained from external signing facility",
  42. "Public Key:", "Select", publicKeyLocationSelectionListener);
  43. externalSignedHashFileField = addGroup(composite, "Signature:",
  44. "Select the Signature file obtained from signing facility.",
  45. "Signature:",
  46. "Select", externalSignedHashFileSelectionListener);
  47. outputSignedEnclaveFileField = addGroup(composite, "Signed Enclave:",
  48. "Select where to save the output Signed Enclave.",
  49. "Signed Enclave:",
  50. "Select", outputSignedEnclaveListener);
  51. return composite;
  52. }
  53. @Override
  54. protected void okPressed() {
  55. handler.enclaveFile = enclaveFileField.getText();
  56. handler.hashFile = hashFileField.getText();
  57. handler.configFile = configFileField.getText();
  58. handler.externalSignPublicKeyFile = externalSignPublicKeyFileField.getText();
  59. handler.externallySignedHashFile = externalSignedHashFileField.getText();
  60. handler.outputSignedEnclaveFile = outputSignedEnclaveFileField.getText();
  61. super.okPressed();
  62. }
  63. @Override
  64. protected void configureShell(Shell newShell) {
  65. super.configureShell(newShell);
  66. newShell.setText("Two Step Enclave Sign - Generate Signed Enclave");
  67. }
  68. }