Examples of SSLKey


Examples of com.alu.e3.prov.restapi.model.SSLKey

  }

  public static final SSLKey fromDataModel(com.alu.e3.data.model.Key key) {
    if (key==null) return null; //throw new IllegalArgumentException("status must not be null");

    SSLKey ret = new SSLKey();

    ret.setActiveCertId(key.getActiveCertId());
    ret.setDisplayName(key.getKeyDetail().getName());
    // do NOT set SSLKey.content and SSLKey.keyPassphrase
    // key data should not be accessible through the provisioning api.
    ret.setId(key.getId());
    ret.setType(key.getKeyDetail().getType());

    return ret;
  }
View Full Code Here

Examples of com.alu.e3.prov.restapi.model.SSLKey

 

  protected final Action newCreateKeyAction() {
    return new  Action("create") {
      protected Object doAction(Object... params) {
        SSLKey key = (SSLKey) params[0];
       
        if ((key.getId() == null) || (key.getId().equals(""))) {
          key.setId(UUID.randomUUID().toString());
        }
       
        if (key.getContent() == null || key.getContent().isEmpty()) {
          throw new IllegalArgumentException("Must include content when creating a key");
        }
        if(key.getDisplayName() == null || key.getDisplayName().isEmpty()) {
          throw new IllegalArgumentException("Must include a display name when creating a key");
        }
       
        if(LOG.isDebugEnabled())
          LOG.debug("Creating SSLKey ID:", key.getId());
       
        // Convert the provisioning object to the true model object
        com.alu.e3.data.model.Key modelKey = BeanConverterUtil.toDataModel(key);
        dataManager.addKey(modelKey);

        SSLKeyResponse response = new SSLKeyResponse(SSLKeyResponse.SUCCESS);
       
        response.setId(key.getId());
        return response;
      }
    };
  }
View Full Code Here

Examples of com.alu.e3.prov.restapi.model.SSLKey

  }
 
  protected final Action newUpdateKeyAction() {
    return new  Action("update") {
      protected Object doAction(Object... params) {
        SSLKey key = (SSLKey) params[0];
        String id = (String) params[1];
       
        if(LOG.isDebugEnabled())
          LOG.debug("Updating SSLKey ID: {}", id);
       
        if(key.getId() == null || key.getId().isEmpty())
          key.setId(id);
        else if(key.getId().equals(id) == false)
          throw new InvalidParameterException("SSLKey ID mismatch");
       
        com.alu.e3.data.model.Key modelKey = BeanConverterUtil.toDataModel(key);
        dataManager.updateKey(modelKey);

        SSLKeyResponse response = new SSLKeyResponse(SSLKeyResponse.SUCCESS);
        response.setId(key.getId());
        return response;
      }
    };
  }
View Full Code Here

Examples of com.alu.e3.prov.restapi.model.SSLKey

       
        if(LOG.isDebugEnabled())
          LOG.debug("Getting Auth ID: {}", id);
       
        com.alu.e3.data.model.Key modelKey = dataManager.getKeyById(id, true);
        SSLKey key = null;
        if(modelKey != null)
          key = BeanConverterUtil.fromDataModel(modelKey);
       
       
        SSLKeyResponse response = new SSLKeyResponse(SSLKeyResponse.SUCCESS);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.