Package org.globus.gsi.gssapi

Examples of org.globus.gsi.gssapi.GlobusGSSCredentialImpl


    protected void setUp() throws IOException
    {
        try
        {
            GlobusCredential gCert = GlobusCredential.getDefaultCredential();
            GSSCredential cert = new GlobusGSSCredentialImpl(gCert, GSSCredential.INITIATE_AND_ACCEPT);
            acc = new SRBAccount(SRBHOST, 5544, cert);
            acc.setDefaultStorageResource(DEFAULT_RESOURCE);

            System.out.println(cert.getName());

            //acc =  new SRBAccount(SRBHOST, 5544, SRB_USERNAME, SRB_PASSWORD, SRB_HOME, SRB_DOMAIN, DEFAULT_RESOURCE);
            sys = new SRBFileSystemExt(acc);

        }
View Full Code Here


                log.debug("GSSCredential isn't instance of GlobusGSSCredentialImpl");
            }
            return null;
        }

        GlobusGSSCredentialImpl globusCred = (GlobusGSSCredentialImpl)cred;
        Certificate [] chain = globusCred.getCertificateChain();
        PrivateKey key = globusCred.getPrivateKey();
        KeyStore store = null;
        ByteArrayOutputStream fOut = null;
        byte[] result = null;
        try {
            store = KeyStore.getInstance("PKCS12", "BC");
View Full Code Here

            tmpCred = proxyInit.getVomsProxy( options );
        } catch (VOMSException e) {
            throw new Exception(e.getMessage(), e);
        }
        GSSCredential vomsCredential = null;
        vomsCredential = new GlobusGSSCredentialImpl(tmpCred,
            GSSCredential.INITIATE_AND_ACCEPT);
        return vomsCredential;
    }
View Full Code Here

   
    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
View Full Code Here

   
    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{

            // TODO verify whether this is correct
      gss.getX509Credential().save(bufos);
      bufos.flush();
     
     
     
      //TODO: to be supported by airavata gsscredential class
View Full Code Here

                CertificateCredential certificateCredential = (CertificateCredential) credential;

                X509Certificate[] certificates = certificateCredential.getCertificates();
                X509Credential newCredential = new X509Credential(certificateCredential.getPrivateKey(), certificates);

                GlobusGSSCredentialImpl cred = new GlobusGSSCredentialImpl(newCredential, GSSCredential.INITIATE_AND_ACCEPT);
                System.out.print(cred.export(ExtendedGSSCredential.IMPEXP_OPAQUE));
                return cred;
                //return new GlobusGSSCredentialImpl(newCredential,
                //        GSSCredential.INITIATE_AND_ACCEPT);
            } else {
                log.info("Credential type is not CertificateCredential. Cannot create mapping globus credentials. " +
View Full Code Here

                //TODO suspecting about the certificate chain .... need to sort that out
                GlobusCredential newCredential = new GlobusCredential(certificateCredential.getPrivateKey(),
                        certificates);

                return new GlobusGSSCredentialImpl(newCredential,
                        GSSCredential.INITIATE_AND_ACCEPT);
            } else {
                log.info("Credential type is not CertificateCredential. Cannot create mapping globus credentials. " +
                        "Credential type - " + credential.getClass().getName());
            }
View Full Code Here

        }
        try {
            GlobusCredential clientCred =
                new GlobusCredential(myproxyClientCert, myproxyClientKey);
            this.credential =
                new GlobusGSSCredentialImpl(clientCred,
                                            GSSCredential.INITIATE_AND_ACCEPT);
        } catch (GSSException e) {
            log.error(e);
        } catch (GlobusCredentialException e) {
            log.error(e);
View Full Code Here

        }
        if (cn == null) {
            throw new IllegalArgumentException("cn is NULL");
        }

        GlobusGSSCredentialImpl userCert = getCert(cn);
        storeCert(username, password, userCert, attributes);

        return buildResult(userCert);
    }
View Full Code Here

                              String passwd) {
        if (! (cred instanceof GlobusGSSCredentialImpl)) {
            log.debug("GSSCredential is not instance of GlobusGSSCredentialImpl");
            return null;
        }
        GlobusGSSCredentialImpl globusCred = (GlobusGSSCredentialImpl)cred;
        Certificate [] chain = globusCred.getCertificateChain();
        if (log.isDebugEnabled()) {
            log.debug("Export Certificates:\n" + Arrays.toString(chain));
        }
        PrivateKey key = globusCred.getPrivateKey();
        KeyStore store = null;
        FileOutputStream fOut = null;
        File p12File = null;
        try {
            store = KeyStore.getInstance("PKCS12", "BC");
View Full Code Here

TOP

Related Classes of org.globus.gsi.gssapi.GlobusGSSCredentialImpl

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.