Examples of ProviderException


Examples of java.security.ProviderException

        Long id = nextSubjectId++;
        SubjectId subjectId;
        try {
            subjectId = new SubjectId(id, hash(id));
        } catch (NoSuchAlgorithmException e) {
            throw new ProviderException("No such algorithm: " + algorithm + ".  This can be caused by a misconfigured java.ext.dirs, JAVA_HOME or JRE_HOME environment variable");
        } catch (InvalidKeyException e) {
            throw new ProviderException("Invalid key: " + key.toString());
        }
        List<String> groups = Collections.emptyList();
        Context context = new Context(subjectId, acc, subject, principal, groups);
        subjectIds.put(context.getId(), subject);
        subjectContexts.put(subject, context);
View Full Code Here

Examples of java.security.ProviderException

        Long id = nextSubjectId++;
        SubjectId subjectId;
        try {
            subjectId = new SubjectId(id, hash(id));
        } catch (NoSuchAlgorithmException e) {
            throw new ProviderException("No such algorithm: " + algorithm + ".  This can be caused by a misconfigured java.ext.dirs, JAVA_HOME or JRE_HOME environment variable");
        } catch (InvalidKeyException e) {
            throw new ProviderException("Invalid key: " + key.toString());
        }
        IdentificationPrincipal principal = new IdentificationPrincipal(subjectId);
       
        if(!subject.isReadOnly()){
            subject.getPrincipals().add(principal);
View Full Code Here

Examples of java.security.ProviderException

        try {
            Mac mac = Mac.getInstance(algorithm);
            mac.init(key);
        } catch (NoSuchAlgorithmException e) {
            assert false : "Should never have reached here";
            throw new ProviderException("No such algorithm: " + algorithm + ".  This can be caused by a misconfigured java.ext.dirs, JAVA_HOME or JRE_HOME environment variable.");
        } catch (InvalidKeyException e) {
            assert false : "Should never have reached here";
            throw new ProviderException("Invalid key: " + key.toString());
        }
    }
View Full Code Here

Examples of java.security.ProviderException

        if ( numBytes <= 0 ) {
            throw new IllegalArgumentException(Messages.getString("security.195", numBytes)); //$NON-NLS-1$
        }

        if ( !serviceAvailable ) {
            throw new ProviderException(
                Messages.getString("security.197") ); //$NON-NLS-1$
        }

        byte[] myBytes = new byte[numBytes];

        if ( !getWindowsRandom(myBytes, numBytes) ) {

            // it is unexpected result
            throw new ProviderException(
                Messages.getString("security.198") ); //$NON-NLS-1$
        }

        return myBytes;
    }
View Full Code Here

Examples of java.security.ProviderException

      {
         sha = MessageDigest.getInstance("SHA");
      }
      catch(NoSuchAlgorithmException e)
      {
         throw new ProviderException("Failed to obtain SHA MessageDigest");
      }
      evenBytes = new ByteArrayOutputStream();
      oddBytes = new ByteArrayOutputStream();
      engineReset();
   }
View Full Code Here

Examples of java.security.ProviderException

      {
         sha = MessageDigest.getInstance("SHA");
      }
      catch(NoSuchAlgorithmException e)
      {
         throw new ProviderException("Failed to obtain SHA MessageDigest");
      }
      evenBytes = new ByteArrayOutputStream();
      oddBytes = new ByteArrayOutputStream();
      engineReset();
   }
View Full Code Here

Examples of java.security.ProviderException

            }
            if ( Security.getProvider(pName)==null ) {
                Security.addProvider( prov );
            }
            if ( Security.getProvider(pName)==null ) {
                throw new ProviderException("Not possible to install provider: "+pName);
            }
        } else {
          if (log.isDebugEnabled()) {
            log.debug("No provider passed to setProvider()");
          }
View Full Code Here

Examples of java.security.ProviderException

                // the below case should not occur because /dev/random or /dev/urandom is a special file
                // hence, if it is happened there is some internal problem
                //
                if ( bytesRead == -1 ) {
                    throw new ProviderException(
                        Messages.getString("security.193") ); //$NON-NLS-1$
                }

                total  += bytesRead;
                offset += bytesRead;

                if ( total >= numBytes ) {
                    break;
                }         
            }
        } catch (IOException e) {

            // actually there should be no IOException because device is a special file;
            // hence, there is either some internal problem or, for instance,
            // device was removed in runtime, or something else
            //
            throw new ProviderException(
                Messages.getString("security.194"), e ); //$NON-NLS-1$
        }
        return bytes;
    }
View Full Code Here

Examples of java.security.ProviderException

        if ( numBytes <= 0 ) {
            throw new IllegalArgumentException(Messages.getString("security.195", numBytes)); //$NON-NLS-1$
        }

        if ( !serviceAvailable ) {
            throw new ProviderException(
                Messages.getString("security.196")); //$NON-NLS-1$
        }

        return getLinuxRandomBits(numBytes);
    }
View Full Code Here

Examples of org.apache.airavata.core.gfac.exception.ProviderException

            if (hostgridFTP == null || hostgridFTP.length == 0) {
                hostgridFTP = new String[] { host.getHostAddress() };
            }

            boolean success = false;
            ProviderException pe = null;// = new ProviderException("");

            for (String endpoint : host.getGridFTPEndPointArray()) {
                try {

                    URI tmpdirURI = GfacUtils.createGsiftpURI(endpoint, app.getScratchWorkingDirectory());
                    URI workingDirURI = GfacUtils.createGsiftpURI(endpoint, app.getStaticWorkingDirectory());
                    URI inputURI = GfacUtils.createGsiftpURI(endpoint, app.getInputDataDirectory());
                    URI outputURI = GfacUtils.createGsiftpURI(endpoint, app.getOutputDataDirectory());

                    log.debug("Host FTP = " + hostgridFTP);
                    log.debug("temp directory = " + tmpdirURI);
                    log.debug("Working directory = " + workingDirURI);
                    log.debug("Input directory = " + inputURI);
                    log.debug("Output directory = " + outputURI);

                    ftp.makeDir(tmpdirURI, gssCred);
                    ftp.makeDir(workingDirURI, gssCred);
                    ftp.makeDir(inputURI, gssCred);
                    ftp.makeDir(outputURI, gssCred);

                    success = true;
                    break;
                } catch (URISyntaxException e) {
                    pe = new ProviderException("URI is malformatted:" + e.getMessage(), e,invocationContext);

                } catch (ToolsException e) {
                    pe = new ProviderException(e.getMessage(), e,invocationContext);
                }
            }
            if (success == false) {
                throw pe;
            }
        } catch (SecurityException e) {
            throw new ProviderException(e.getMessage(), e,invocationContext);
        }
    }
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.