Package java.security

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


        /** For now, the implementation forwards to the cases where n
         * is in the range of the standard integers. This might, however, be
         * implemented to decompose larger powers into cascaded calls to smaller ones.
         */
        if (n.compareTo(Rational.MAX_INT) > 0 || n.compareTo(Rational.MIN_INT) < 0)
            throw new ProviderException("Not implemented: big power " + n.toString());
        else
            return powRound(x, n.intValue());
    } /* BigDecimalMath.powRound */
 
View Full Code Here

    static public BigDecimal pochhammer(final BigDecimal x, final int n) {
        /*
         * reduce to interval near 1.0 with the functional relation, Abramowitz-Stegun 6.1.33
         */
        if (n < 0)
            throw new ProviderException("Not implemented: pochhammer with negative index " + n);
        else if (n == 0)
            return BigDecimal.ONE;
        else {
            /*
             * internally two safety digits
View Full Code Here

    static public BigDecimal zeta(final int n, final MathContext mc, Bernoulli bern_cache, Factorial fact_cache) {
       
        MathContext nmc=new MathContext(3+mc.getPrecision(),mc.getRoundingMode());
       
        if (n <= 0)
            throw new ProviderException("Not implemented: zeta at negative argument " + n);
        if (n == 1)
            throw new ArithmeticException("Pole at zeta(1) ");

        if (n % 2 == 0) {
            /*
 
View Full Code Here

            6.310887241768094495682609390e-30,
            3.155443620884047239109841220e-30,
            1.577721810442023616644432780e-30,
            7.888609052210118073520537800e-31 };
        if (n <= 0)
            throw new ProviderException("Not implemented: zeta at negative argument " + n);
        if (n == 1)
            throw new ArithmeticException("Pole at zeta(1) ");

        if (n < zmin1.length)
            /* look it up if available */
 
View Full Code Here

            "New message",
            "Long message for Exception. Long message for Exception. Long message for Exception." };

    protected Object[] getData() {
        Exception cause = new Exception(msgs[1]);
        ProviderException dExc = new ProviderException(msgs[0], cause);
        String msg = null;
        Throwable th = null;
        return new Object[] { new ProviderException(), new ProviderException(msg),
                new ProviderException(msgs[1]),
                new ProviderException(new Throwable()), new ProviderException(th),
                new ProviderException(msgs[1], dExc) };
    }
View Full Code Here

    /**
     * Test for <code>ProviderException()</code> constructor Assertion:
     * constructs ProviderException with no detail message
     */
    public void testProviderException01() {
        ProviderException tE = new ProviderException();
        assertNull("getMessage() must return null.", tE.getMessage());
        assertNull("getCause() must return null", tE.getCause());
    }
View Full Code Here

     * Test for <code>ProviderException(String)</code> constructor Assertion:
     * constructs ProviderException with detail message msg. Parameter
     * <code>msg</code> is not null.
     */
    public void testProviderException02() {
        ProviderException tE;
        for (int i = 0; i < msgs.length; i++) {
            tE = new ProviderException(msgs[i]);
            assertEquals("getMessage() must return: ".concat(msgs[i]), tE
                    .getMessage(), msgs[i]);
            assertNull("getCause() must return null", tE.getCause());
        }
    }
View Full Code Here

     * Test for <code>ProviderException(String)</code> constructor Assertion:
     * constructs ProviderException when <code>msg</code> is null
     */
    public void testProviderException03() {
        String msg = null;
        ProviderException tE = new ProviderException(msg);
        assertNull("getMessage() must return null.", tE.getMessage());
        assertNull("getCause() must return null", tE.getCause());
    }
View Full Code Here

     * Test for <code>ProviderException(Throwable)</code> constructor
     * Assertion: constructs ProviderException when <code>cause</code> is null
     */
    public void testProviderException04() {
        Throwable cause = null;
        ProviderException tE = new ProviderException(cause);
        assertNull("getMessage() must return null.", tE.getMessage());
        assertNull("getCause() must return null", tE.getCause());
    }
View Full Code Here

TOP

Related Classes of java.security.ProviderException

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.