Package io.apigee.trireme.core.internal

Examples of io.apigee.trireme.core.internal.CryptoService


        ByteArrayInputStream bis =
            new ByteArrayInputStream(certBuf.getArray(), certBuf.getArrayOffset(),
                                     certBuf.getLength());

        CryptoService crypto = Crypto.getCryptoService();
        try {
            try {
                pubKey = crypto.readPublicKey(self.algorithm.getKeyFormat(), bis);
            } catch (CryptoException ce) {
                // It might not be a key
            }

            if (pubKey == null) {
                bis.reset();
                try {
                    KeyPair pair = crypto.readKeyPair(self.algorithm.getKeyFormat(), bis, null);
                    pubKey = pair.getPublic();
                } catch (CryptoException ce) {
                    // And it might not be a key pair either
                }
            }

            if (pubKey == null) {
                bis.reset();
                cert = crypto.readCertificate(bis);

                if (cert == null) {
                    throw Utils.makeError(cx, thisObj, "no certificates available");
                }
            }
View Full Code Here

TOP

Related Classes of io.apigee.trireme.core.internal.CryptoService

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.