Examples of NoSuchAlgorithmException


Examples of java.security.NoSuchAlgorithmException

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

Examples of java.security.NoSuchAlgorithmException

        this.privKey = privKey;
        this.provider = provider;

        digestAlgorithm = allowedDigests.get(hashAlgorithm.toUpperCase());
        if (digestAlgorithm == null)
            throw new NoSuchAlgorithmException(MessageLocalization.getComposedMessage("unknown.hash.algorithm.1", hashAlgorithm));

        version = signerversion = 1;
        certs = new ArrayList<Certificate>();
        crls = new ArrayList<CRL>();
        digestalgos = new HashSet<String>();
        digestalgos.add(digestAlgorithm);

        //
        // Copy in the certificates and crls used to sign the private key.
        //
        signCert = (X509Certificate)certChain[0];
        for (Certificate element : certChain) {
            certs.add(element);
        }

        if (crlList != null) {
            for (CRL element : crlList) {
                crls.add(element);
            }
        }

        if (privKey != null) {
            //
            // Now we have private key, find out what the digestEncryptionAlgorithm is.
            //
            digestEncryptionAlgorithm = privKey.getAlgorithm();
            if (digestEncryptionAlgorithm.equals("RSA")) {
                digestEncryptionAlgorithm = ID_RSA;
            }
            else if (digestEncryptionAlgorithm.equals("DSA")) {
                digestEncryptionAlgorithm = ID_DSA;
            }
            else {
                throw new NoSuchAlgorithmException(MessageLocalization.getComposedMessage("unknown.key.algorithm.1", digestEncryptionAlgorithm));
            }
        }
        if (hasRSAdata) {
            RSAdata = new byte[0];
            if (provider == null || provider.startsWith("SunPKCS11"))
View Full Code Here

Examples of net.rim.device.api.crypto.NoSuchAlgorithmException

            throws NoSuchAlgorithmException, CryptoTokenException {
        if (algorithm.equals(RSA)) {
            return new MyRSACryptoToken();
        }

        throw new NoSuchAlgorithmException();
    }
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.