Package org.apache.airavata.gfac.context.security

Examples of org.apache.airavata.gfac.context.security.GSISecurityContext


  protected abstract MessageContext getInMessageContext();

  protected abstract MessageContext getOutMessageContext();

  private GSISecurityContext getSecurityContext() {
    GSISecurityContext context = new GSISecurityContext();
    context.setMyproxyLifetime(3600);
    context.setMyproxyServer("myproxy.teragrid.org");
    context.setMyproxyUserName("******");
    context.setMyproxyPasswd("*******");
    // Add Unicore certificate to this folder
    context.setTrustedCertLoc("/Users/raminder/.globus/certificates");
    return context;
  }
View Full Code Here


    @Before
    public void setUp() throws Exception {

        GFacConfiguration gFacConfiguration = new GFacConfiguration(null);
        GSISecurityContext context = new GSISecurityContext();
    context.setMyproxyLifetime(3600);
    context.setMyproxyServer("myproxy.teragrid.org");
    context.setMyproxyUserName("*****");
    context.setMyproxyPasswd("*****");
    context.setTrustedCertLoc("./certificates");

        //have to set InFlwo Handlers and outFlowHandlers
        gFacConfiguration.setInHandlers(Arrays.asList(new String[]{"org.apache.airavata.gfac.handler.GramDirectorySetupHandler", "org.apache.airavata.gfac.handler.GridFTPInputHandler"}));
        gFacConfiguration.setOutHandlers(Arrays.asList(new String[] {"org.apache.airavata.gfac.handler.GridFTPOutputHandler"}));
        /*
 
View Full Code Here

    }

  private void addSecurityContext(HostDescription registeredHost, Properties configurationProperties,
      JobExecutionContext jobExecutionContext) {
    if (registeredHost.getType() instanceof GlobusHostType || registeredHost.getType() instanceof UnicoreHostType) {
      GSISecurityContext context = new GSISecurityContext();
      context.setMyproxyLifetime(Integer.parseInt(configurationProperties.getProperty(Constants.MYPROXY_LIFE)));
      context.setMyproxyServer(configurationProperties.getProperty(Constants.MYPROXY_SERVER));
      context.setMyproxyUserName(configurationProperties.getProperty(Constants.MYPROXY_USER));
      context.setMyproxyPasswd(configurationProperties.getProperty(Constants.MYPROXY_PASS));
      context.setTrustedCertLoc(configurationProperties.getProperty(Constants.TRUSTED_CERT_LOCATION));
      jobExecutionContext.addSecurityContext(GSISecurityContext.GSI_SECURITY_CONTEXT, context);

    } else if (registeredHost.getType() instanceof Ec2HostType) {
      if (this.configuration.getAmazonSecurityContext() != null) {
        jobExecutionContext.addSecurityContext(AmazonSecurityContext.AMAZON_SECURITY_CONTEXT,
            this.configuration.getAmazonSecurityContext());
      }
    } else if (registeredHost.getType() instanceof SSHHostType) {
      SSHSecurityContext context = new SSHSecurityContext();
      context.setUsername(configurationProperties.getProperty(Constants.SSH_USER_NAME));
      context.setPrivateKeyLoc(configurationProperties.getProperty(Constants.SSH_PRIVATE_KEY));
      context.setKeyPass(configurationProperties.getProperty(Constants.SSH_PRIVATE_KEY_PASS));
      jobExecutionContext.addSecurityContext(SSHSecurityContext.SSH_SECURITY_CONTEXT, context);

    }
  }
View Full Code Here

        jobExecutionContext.setOutMessageContext(outMessage);

    }

  private GSISecurityContext getSecurityContext() {
    GSISecurityContext context = new GSISecurityContext();
        context.setMyproxyLifetime(3600);
        context.setMyproxyServer("myproxy.teragrid.org");
        context.setMyproxyUserName("*****");
        context.setMyproxyPasswd("*****");
        context.setTrustedCertLoc("./certificates");
    return context;
  }
View Full Code Here

   
   
    return om1;
  }
  private GSISecurityContext getSecurityContext() {
    GSISecurityContext context = new GSISecurityContext();
        context.setMyproxyLifetime(3600);
        context.setMyproxyServer("myproxy.teragrid.org");
        context.setMyproxyUserName("******");
        context.setMyproxyPasswd("*********");
        context.setTrustedCertLoc("**********");
    return context;
  }
View Full Code Here

   
    if (secProperties != null) return;
   

   
    GSISecurityContext gssContext = (GSISecurityContext)jobExecutionContext.getSecurityContext(GSISecurityContext.GSI_SECURITY_CONTEXT);
//    GlobusCredential credentials = gssContext.getGlobusCredential();
   
    GlobusGSSCredentialImpl gss = (GlobusGSSCredentialImpl) gssContext.getGssCredentails();
   
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
   
    BufferedOutputStream bufos = new BufferedOutputStream(bos);
   
    ByteArrayInputStream bis = null;
    BufferedInputStream bufis = null;
    try{
      gss.getGlobusCredential().save(bufos);
      bufos.flush();
     
     
     
      //TODO: to be supported by airavata gsscredential class
      List<String> trustedCert = new ArrayList<String>();
      trustedCert.add(gssContext.getTrustedCertLoc()+"/*.0");
      trustedCert.add(gssContext.getTrustedCertLoc()+"/*.pem");
     
      char[] c = null;
     
      DirectoryCertChainValidator dcValidator = new DirectoryCertChainValidator(trustedCert, Encoding.PEM, -1, 60000, null);
      bis = new ByteArrayInputStream(bos.toByteArray());
View Full Code Here

        return om1;
    }

    private GSISecurityContext getSecurityContext() {
        GSISecurityContext context = new GSISecurityContext("myproxy.teragrid.org", "******", "*********", 3600,
                "**********");
        return context;
    }
View Full Code Here

   
    if (secProperties != null) return;
   

   
    GSISecurityContext gssContext = (GSISecurityContext)jobExecutionContext.
                getSecurityContext(GSISecurityContext.GSI_SECURITY_CONTEXT);

    GlobusGSSCredentialImpl gss = (GlobusGSSCredentialImpl) gssContext.getGssCredentials();
   
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
   
    BufferedOutputStream bufos = new BufferedOutputStream(bos);
   
    ByteArrayInputStream bis = null;
    BufferedInputStream bufis = null;
    try{
      gss.getGlobusCredential().save(bufos);
      bufos.flush();
     
     
     
      //TODO: to be supported by airavata gsscredential class
      List<String> trustedCert = new ArrayList<String>();
      trustedCert.add(gssContext.getMyProxyManager().getTrustedCertsLoc() + "/*.0");
      trustedCert.add(gssContext.getMyProxyManager().getTrustedCertsLoc() + "/*.pem");
     
      char[] c = null;
     
      DirectoryCertChainValidator dcValidator = new DirectoryCertChainValidator(trustedCert, Encoding.PEM, -1, 60000, null);
      bis = new ByteArrayInputStream(bos.toByteArray());
View Full Code Here

  protected abstract MessageContext getInMessageContext();

  protected abstract MessageContext getOutMessageContext();

  private GSISecurityContext getSecurityContext() {
    GSISecurityContext context = new GSISecurityContext("myproxy.teragrid.org", "******", "*******", 3600,
                "/Users/raminder/.globus/certificates");
    return context;
  }
View Full Code Here

    @Before
    public void setUp() throws Exception {

        GFacConfiguration gFacConfiguration = new GFacConfiguration(null);
        GSISecurityContext context = new GSISecurityContext("myproxy.teragrid.org", "*****", "*****", 3600, "./certificates");

        //have to set InFlwo Handlers and outFlowHandlers
        gFacConfiguration.setInHandlers(Arrays.asList(new GFacHandlerConfig[]{new GFacHandlerConfig(null,"org.apache.airavata.gfac.handler.GramDirectorySetupHandler"), new GFacHandlerConfig(null,"org.apache.airavata.gfac.handler.GridFTPInputHandler")}));
        gFacConfiguration.setOutHandlers(Arrays.asList(new GFacHandlerConfig[] {new GFacHandlerConfig(null,"org.apache.airavata.gfac.handler.GridFTPOutputHandler")}));
        /*
 
View Full Code Here

TOP

Related Classes of org.apache.airavata.gfac.context.security.GSISecurityContext

Copyright © 2018 www.massapicom. 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.