Package org.jose4j.keys

Examples of org.jose4j.keys.X509Util


        if (params.containsKey(X509_CERTIFICATE_CHAIN_PARAMETER))
        {
            List<String> x5cStrings = JsonHelp.getStringArray(params, X509_CERTIFICATE_CHAIN_PARAMETER);
            certificateChain = new ArrayList<X509Certificate>(x5cStrings.size());

            X509Util x509Util = new X509Util();

            for (String b64EncodedDer : x5cStrings)
            {
                X509Certificate x509Certificate = x509Util.fromBase64Der(b64EncodedDer);
                certificateChain.add(x509Certificate);
            }
        }
    }
View Full Code Here


    {
        fillPublicTypeSpecificParams(params);

        if (certificateChain != null)
        {
            X509Util x509Util = new X509Util();
            List<String> x5cStrings = new ArrayList<String>(certificateChain.size());

            for (X509Certificate cert : certificateChain)
            {
               String b64EncodedDer = x509Util.toPem(cert);
               x5cStrings.add(b64EncodedDer);
            }

            params.put(X509_CERTIFICATE_CHAIN_PARAMETER, x5cStrings);
        }
View Full Code Here

        "  C1u+mNr0HZDzTuIYEZoDJJKPTEjlbVUjP9UNV+mWwD5MlM/Mtsq2azSiGM5bUMM\n" +
        "  j4QssxsodyamEwCW/POuZ6lcg5Ktz885hZo+L7tdEy8W9ViH0Pd\"]}";

        Map<String,Object> stringObjectMap = JsonUtil.parseJson(x5cFromJws);
        List<String> x5c = JsonHelp.getStringArray(stringObjectMap, "x5c");
        X509Util xu = new X509Util();
        X509Certificate x509Certificate = xu.fromBase64Der(x5c.get(0));

        PublicKey publicKey = x509Certificate.getPublicKey();
        PublicJsonWebKey jwk = PublicJsonWebKey.Factory.newPublicJwk(publicKey);

        List<X509Certificate> chain = new ArrayList<X509Certificate>();
        for (String s : x5c)
        {
            chain.add(xu.fromBase64Der(s));
        }

        jwk.setCertificateChain(chain);

        PublicJsonWebKey parsedJwk = PublicJsonWebKey.Factory.newPublicJwk(jwk.toJson());
View Full Code Here

TOP

Related Classes of org.jose4j.keys.X509Util

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.