Examples of NoSuchAlgorithmException


Examples of java.security.NoSuchAlgorithmException

            privateKeyOnly = false;
            publicKeyOnly = true;
            return;
        }
       
        throw new NoSuchAlgorithmException("can't support mode " + mode);
    }
View Full Code Here

Examples of java.security.NoSuchAlgorithmException

    {
        if (kdf != null)
        {
            if (!algorithms.containsKey(algorithm))
            {
                throw new NoSuchAlgorithmException("unknown algorithm encountered: " + algorithm);
            }
           
            int    keySize = ((Integer)algorithms.get(algorithm)).intValue();

            DHKDFParameters params = new DHKDFParameters(new DERObjectIdentifier(algorithm), keySize, bigIntToBytes(result));
View Full Code Here

Examples of java.security.NoSuchAlgorithmException

    protected void engineSetMode(
        String  mode)
        throws NoSuchAlgorithmException
    {
        throw new NoSuchAlgorithmException("can't support mode " + mode);
    }
View Full Code Here

Examples of java.security.NoSuchAlgorithmException

        if (md.equals("NONE") || md.equals("ECB"))
        {
            return;
        }
       
        throw new NoSuchAlgorithmException("can't support mode " + mode);
    }
View Full Code Here

Examples of java.security.NoSuchAlgorithmException

        TrustManagerFactory factory = TrustManagerFactory.getInstance( TrustManagerFactory.getDefaultAlgorithm() );
        factory.init( keystore );
        TrustManager[] trustmanagers = factory.getTrustManagers();
        if ( trustmanagers.length == 0 )
        {
            throw new NoSuchAlgorithmException( "no trust manager found" );
        }
        this.standardTrustManager = (X509TrustManager) trustmanagers[0];
    }
View Full Code Here

Examples of java.security.NoSuchAlgorithmException

        try {
            super.setUp();
        } catch (Exception e) {
            // ignore if algorithm is not on the OS
            NoSuchAlgorithmException nsae = ObjectHelper.getException(NoSuchAlgorithmException.class, e);
            if (nsae != null) {
                canTest = false;

                // warn both through console as well as log that we can not run the test
                String name = System.getProperty("os.name");
                String message = nsae.getMessage();
                System.out.println("SunX509 is not avail on this platform [" + name + "] Testing is skipped! Real cause: " + message);
                log.warn("SunX509 is not avail on this platform [{}] Testing is skipped! Real cause: {}", name, message);
            } else {
                // some other error then throw it so the test can fail
                throw e;
View Full Code Here

Examples of java.security.NoSuchAlgorithmException

            sshd.setCommandFactory(new ScpCommandFactory());
            sshd.setPasswordAuthenticator(new MyPasswordAuthenticator());
            sshd.start();
        } catch (Exception e) {
            // ignore if algorithm is not on the OS
            NoSuchAlgorithmException nsae = ObjectHelper.getException(NoSuchAlgorithmException.class, e);
            if (nsae != null) {
                canTest = false;

                // warn both through console as well as log that we can not run the test
                String name = System.getProperty("os.name");
                String message = nsae.getMessage();
                System.out.println("SunX509 is not avail on this platform [" + name + "] Testing is skipped! Real cause: " + message);
                log.warn("SunX509 is not avail on this platform [{}] Testing is skipped! Real cause: {}", name, message);
            } else {
                // some other error then throw it so the test can fail
                throw e;
View Full Code Here

Examples of java.security.NoSuchAlgorithmException

        Logger log = getLogger();
        String jceAlgorithmName = getKeyAlgorithmFromURI(algoURI);
        if (DatatypeHelper.isEmpty(jceAlgorithmName)) {
            log.error("Mapping from algorithm URI '" + algoURI
                    + "' to key algorithm not available, key generation failed");
            throw new NoSuchAlgorithmException("Algorithm URI'" + algoURI + "' is invalid for key generation");
        }
        Integer keyLength = getKeyLengthFromURI(algoURI);
        if (keyLength == null) {
            log.error("Key length could not be determined from algorithm URI, can't generate key");
            throw new KeyException("Key length not determinable from algorithm URI, could not generate new key");
View Full Code Here

Examples of java.security.NoSuchAlgorithmException

        } else if (algorithm.equals(DOMDigestMethod.SHA384)) {
            return new DOMDigestMethod.SHA384(params);
        } else if (algorithm.equals(DigestMethod.SHA512)) {
            return new DOMDigestMethod.SHA512(params);
  } else {
      throw new NoSuchAlgorithmException("unsupported algorithm");
  }
    }
View Full Code Here

Examples of java.security.NoSuchAlgorithmException

        } else if (algorithm.equals(DOMSignatureMethod.HMAC_SHA384)) {
            return new DOMHMACSignatureMethod.SHA384(params);
        } else if (algorithm.equals(DOMSignatureMethod.HMAC_SHA512)) {
            return new DOMHMACSignatureMethod.SHA512(params);
        } else {
            throw new NoSuchAlgorithmException("unsupported algorithm");
        }
    }
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.