Examples of CredentialException


Examples of org.apache.oozie.action.hadoop.CredentialException

    @Override
    public void addtoJobConf(JobConf jobconf, CredentialsProperties props, Context context) throws Exception {
        try {
            String principal = props.getProperties().get(HCAT_METASTORE_PRINCIPAL);
            if (principal == null || principal.isEmpty()) {
                throw new CredentialException(ErrorCode.E0510,
                        HCAT_METASTORE_PRINCIPAL + " is required to get hcat credential");
            }
            String server = props.getProperties().get(HCAT_METASTORE_URI);
            if (server == null || server.isEmpty()) {
                throw new CredentialException(ErrorCode.E0510,
                        HCAT_METASTORE_URI + " is required to get hcat credential");
            }
            HCatCredentialHelper hcch = new HCatCredentialHelper();
            hcch.set(jobconf, principal, server);
        }
View Full Code Here

Examples of org.apache.ws.security.components.crypto.CredentialException

                }
            }
        } catch (Exception e) {
            e.printStackTrace();
            log.error("error creating ServerCryto",e);
            throw new CredentialException(3, "secError00", e);
        }

        /**
         * Load cacerts
         */
        String cacertsPath = System.getProperty("java.home") + "/lib/security/cacerts";
        InputStream cacertsIs = new FileInputStream(cacertsPath);
        try {
            String cacertsPasswd = properties.getProperty(PROP_ID_CACERT_PASS, "changeit");
            cacerts = KeyStore.getInstance(KeyStore.getDefaultType());
            cacerts.load(cacertsIs, cacertsPasswd.toCharArray());

        } catch (GeneralSecurityException e) {
            log.error("", e);
            throw new CredentialException(3, "secError00", e);
        } finally {
            cacertsIs.close();
        }

    }
View Full Code Here

Examples of org.apache.ws.security.components.crypto.CredentialException

        {
          return KeyMaterialWssCrypto.this.load();
        }
        catch( Exception e )
        {
          throw new CredentialException( 0, null, e );
        }
      }
      else
        return super.load( input, storepass, provider, type );
    }
View Full Code Here

Examples of org.apache.ws.security.components.crypto.CredentialException

     */
    if (is == null) {
      try {
        is = new FileInputStream(location);
      } catch (Exception e) {
        throw new CredentialException(3, "proxyNotFound",
            new Object[] { location });
      }
    }

    /**
 
View Full Code Here

Examples of org.apache.ws.security.components.crypto.CredentialException

                throws CredentialException {
            if ("this".equals(provider)) {
                try {
                    return KeyMaterialWssCrypto.this.load();
                } catch (Exception e) {
                    throw new CredentialException(0, null, e);
                }
            } else {
                return super.load(input, storepass, provider, type);
            }
        }
View Full Code Here

Examples of org.geogrid.aist.credential.services.security.gss.CredentialException

        try {
            dn = cred.getName().toString();
            this.credential = cred;
        } catch (GSSException e) {
            log.error("Error getting gss credential dn", e);
            throw new CredentialException(e.getMessage());
        }
    }
View Full Code Here

Examples of org.geogrid.aist.credential.services.security.gss.CredentialException

    }

    public void activate(GSSCredential cred)
            throws CredentialException {
        if (cred == null) {
            throw new CredentialException("No credential was provided for this context : " + dn);
        }
        try {
            if (cred.getRemainingLifetime() == 0) {
                throw new CredentialException("Credential is expired for this context : " + dn);
            }
            String credDn = cred.getName().toString();
            if (!credDn.equals(dn)) {
                throw new CredentialException("Credential dn [" + credDn + "] is invalid for this context : " + dn);
            }
            setDateLastActivated(new Date());
        } catch (GSSException e) {
            log.error("Unknown error for credential context : " + dn, e);
            throw new CredentialException("Unknown error for credential context : " + dn, e);
        }
        CredentialManagerServiceImpl.setCredential(dn, cred);
        this.credential = cred;
    }
View Full Code Here

Examples of org.geogrid.aist.credential.services.security.gss.CredentialException

        String credDn = null;
        try {
            credDn = credential.getName().toString();
        } catch (GSSException e) {
            log.warn(e.getMessage());
            throw new CredentialException("Unknown error occured", e);
        }
        CredentialContext context = getCredentialContextByDn(credDn);
        if (context == null) {
            throw new CredentialException("No credentialContext context found with dn " + credDn);
        }
        context.activate(credential);
        saveCredentialContext(context);
        return context;
   }
View Full Code Here

Examples of org.geogrid.aist.credential.services.security.gss.CredentialException

                if (fileName != null) {
                    credentialFiles.put(dn, fileName);
                }
            } catch (IOException e) {
                log.error("Unable to save credential to file", e);
                throw new CredentialException("Unable to save credential to file");
            }
        }
        credentials.put(dn, credential);
    }
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.