Package org.apache.airavata.credential.store.credential

Examples of org.apache.airavata.credential.store.credential.Credential


    public String getPortalUser(String gatewayName, String tokenId) throws CredentialStoreException {

        Connection connection = getConnection();

        Credential credential;

        try {
            credential = this.credentialsDAO.getCredential(gatewayName, tokenId, connection);

        } finally {
            DBUtil.cleanup(connection);
        }

        return credential.getPortalUserName();
    }
View Full Code Here


        if (getCredentialReader() == null) {
            return null;
        }

        Credential credential = getCredentialReader().getCredential(getRequestData().getGatewayId(),
                getRequestData().getTokenId());

        if (credential != null) {
            if (credential instanceof CertificateCredential) {

                log.info("Successfully found credentials for token id - " + getRequestData().getTokenId() +
                        " gateway id - " + getRequestData().getGatewayId());

                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. " +
                        "Credential type - " + credential.getClass().getName());
            }
        } else {
            log.info("Could not find credentials for token - " + getRequestData().getTokenId() + " and "
                    + "gateway id - " + getRequestData().getGatewayId());
        }
View Full Code Here

                // CertificateCredential certificateCredential = new CertificateCredential();

                Blob blobCredentials = resultSet.getBlob("CREDENTIAL");
                byte[] certificate = blobCredentials.getBytes(1, (int) blobCredentials.length());

                Credential certificateCredential = (Credential) convertByteArrayToObject(certificate);

                certificateCredential.setPortalUserName(resultSet.getString("PORTAL_USER_ID"));
                certificateCredential.setCertificateRequestedTime(resultSet.getTimestamp("TIME_PERSISTED"));

                return certificateCredential;
            }

        } catch (SQLException e) {
View Full Code Here

            preparedStatement.setString(1, gatewayName);

            resultSet = preparedStatement.executeQuery();

            Credential certificateCredential;

            while (resultSet.next()) {

                Blob blobCredentials = resultSet.getBlob("CREDENTIAL");
                byte[] certificate = blobCredentials.getBytes(1, (int) blobCredentials.length());

                certificateCredential = (Credential) convertByteArrayToObject(certificate);

                certificateCredential.setPortalUserName(resultSet.getString("PORTAL_USER_ID"));
                certificateCredential.setCertificateRequestedTime(resultSet.getTimestamp("TIME_PERSISTED"));

                credentialList.add(certificateCredential);
            }

        } catch (SQLException e) {
View Full Code Here

TOP

Related Classes of org.apache.airavata.credential.store.credential.Credential

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.