Package org.globus.gsi

Examples of org.globus.gsi.TrustedCertificates


        this.trustedCertsLoc = trustedCertsLoc;
    }

    private void init() {
        if (trustedCertsLoc != null) {
            TrustedCertificates certificates = TrustedCertificates.load(trustedCertsLoc);
            TrustedCertificates.setDefaultTrustedCertificates(certificates);
        }
    }
View Full Code Here


    private void init() {
        // Load CA certificates from a file included in the XBaya jar.
        this.trustedCertificates = XBayaSecurity.getTrustedCertificates();

        TrustedCertificates certificatesArray = new TrustedCertificates(
                this.trustedCertificates);
        TrustedCertificates.setDefaultTrustedCertificates(certificatesArray);
    }
View Full Code Here

  }

  public void loadCertificate(String trustedCertsFile) {
    if (trustedCertsFile != null) {
      if (new File(trustedCertsFile).isDirectory()) {
        TrustedCertificates certificates = TrustedCertificates.load(trustedCertsFile);
        TrustedCertificates.setDefaultTrustedCertificates(certificates);
        this.setTrustedCertificates(certificates.getCertificates());
      } else {
        this.setTrustedCertificates(CertificateManager.getTrustedCertificates(trustedCertsFile));

        TrustedCertificates certificatesArray = new TrustedCertificates(this.getTrustedCertificates());
        TrustedCertificates.setDefaultTrustedCertificates(certificatesArray);
      }
    }
  }
View Full Code Here

  }

  private void init() {
    if(trustedCertsFile != null){
      if(new File(trustedCertsFile).isDirectory()){
        TrustedCertificates certificates = TrustedCertificates.load(trustedCertsFile);
        TrustedCertificates.setDefaultTrustedCertificates(certificates)
      }else
      this.trustedCertificates = CertificateManager.getTrustedCertificate(trustedCertsFile);

      TrustedCertificates certificatesArray = new TrustedCertificates(
          this.trustedCertificates);
      TrustedCertificates.setDefaultTrustedCertificates(certificatesArray);
      }
      }
  }
View Full Code Here

        this.port = MyProxy.DEFAULT_PORT;
    }
 
  private void init() {
    if(trustedCertsLoc != null){
      TrustedCertificates certificates = TrustedCertificates.load(trustedCertsLoc);
    TrustedCertificates.setDefaultTrustedCertificates(certificates);
    }
  }
View Full Code Here

        this.myproxyLifeTime);
  }
  private void init() {
    if(trustedCertsFile != null){
      if(new File(trustedCertsFile).isDirectory()){
        TrustedCertificates certificates = TrustedCertificates.load(trustedCertsFile);
        TrustedCertificates.setDefaultTrustedCertificates(certificates)
      }else
      this.trustedCertificates = CertificateManager.getTrustedCertificate(trustedCertsFile);

      TrustedCertificates certificatesArray = new TrustedCertificates(
          this.trustedCertificates);
      TrustedCertificates.setDefaultTrustedCertificates(certificatesArray);
      }
      }
  }
View Full Code Here

        }else if(useHostKey && certFile != null && keyfile != null && new File(certFile).isFile()){
            invoker = new PuretlsInvoker(keyfile, "", certFile);
        }else {
            X509Certificate[] certs = globalConfiguration.getTrustedCertificates();
            if(certs != null && certFile != null){
              TrustedCertificates certificates = TrustedCertificates.load(certFile);
            TrustedCertificates.setDefaultTrustedCertificates(certificates);
              certs = certificates.getCertificates();
            }else{
                ClassLoader cl = Thread.currentThread().getContextClassLoader();
                InputStream trustedCasInStream = cl.getResourceAsStream("xregistry/trusted_cas.pem");
                if(trustedCasInStream != null){
                    File tempTrustedCas = File.createTempFile("trusted_cas","pem");
View Full Code Here

        hostname = "rainier.extreme.indiana.edu";
        this.port = MyProxy.DEFAULT_PORT;
    }
    private void init() {
    if(trustedCertsLoc != null){
      TrustedCertificates certificates = TrustedCertificates.load(trustedCertsLoc);
    TrustedCertificates.setDefaultTrustedCertificates(certificates);
    }
  }
View Full Code Here

                    if(globalContext.getTrustedCertificates() != null){
                        ctx.setTrustedCertificates(globalContext.getTrustedCertificates());
                    }else if(trustedCertsFile != null && new File(trustedCertsFile).isFile()){
                        ctx.loadRootCertificates(trustedCertsFile);   
                    }else if(trustedCertsFile != null && new File(trustedCertsFile).isDirectory()){
                      TrustedCertificates certificates = TrustedCertificates.load(trustedCertsFile);
                    TrustedCertificates.setDefaultTrustedCertificates(certificates);
                      ctx.setTrustedCertificates(certificates.getCertificates());   
                    }
                    else{
                        TrustedCertificates tc = TrustedCertificates.getDefaultTrustedCertificates();
                        ctx.setTrustedCertificates(tc.getCertificates());
                    }
                    ctx.loadEAYKeyFile(certKeyFile, "");
                    SSLPolicyInt policy = new SSLPolicyInt();
                    policy.requireClientAuth(true);
                    policy.setAcceptNoClientCert(true);
                    ctx.setPolicy(policy);
                }else{
                    //Use Globous crednatials if it is there
                    try {
                        ctx = new PureTLSContext();
                        GSSCredential gssCredntial = globalContext.getCredential();
                        if(gssCredntial instanceof GlobusGSSCredentialImpl){
                            GlobusCredential globusCred = ((GlobusGSSCredentialImpl)gssCredntial).getGlobusCredential();
                            TrustedCertificates tc = TrustedCertificates.getDefaultTrustedCertificates();
                            if (tc == null)
                            {
                                throw new XregistryException("Trusted certificates is null");
                            }
                            X509Certificate[] certs = tc.getCertificates();
                            ctx.setTrustedCertificates(certs);
                            ctx.setCredential(globusCred);
                        }else{
                            throw new XregistryException("Can not find the credantial to start a secure server");
                        }
View Full Code Here

    try {
      if (sessionCredentail != null && trustedCertFile != null) {
        if (new File(trustedCertFile).isFile()) {
          this.xregistryClient = new XRegistryClient(sessionCredentail, trustedCertFile, xregistryUrl);
        } else {
          TrustedCertificates certificates = TrustedCertificates.load(trustedCertFile);
          TrustedCertificates.setDefaultTrustedCertificates(certificates);
          X509Certificate[] trustedCertificates = certificates.getCertificates();
          System.out.println("xregistryUrl=" + xregistryUrl);
          System.out.println("trustedCertificates=" + trustedCertificates);
          this.xregistryClient = new XRegistryClient(sessionCredentail, trustedCertificates, xregistryUrl);
        }
      } else {
View Full Code Here

TOP

Related Classes of org.globus.gsi.TrustedCertificates

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.