Package org.jose4j.jwk

Examples of org.jose4j.jwk.PublicJsonWebKey.toJson()


        assertTrue(pem.charAt(BaseNCodec.PEM_CHUNK_SIZE) == '\r');
        assertTrue(pem.charAt(BaseNCodec.PEM_CHUNK_SIZE + 1) == '\n');

        PublicJsonWebKey jwk = PublicJsonWebKey.Factory.newPublicJwk(x509Certificate.getPublicKey());
        jwk.setCertificateChain(x509Certificate);
        String jsonJwk = jwk.toJson(JsonWebKey.OutputControlLevel.PUBLIC_ONLY);

        PublicJsonWebKey jwkFromJson = PublicJsonWebKey.Factory.newPublicJwk(jsonJwk);
        assertEquals(x509Certificate.getPublicKey(), jwkFromJson.getPublicKey());
        assertEquals(x509Certificate, jwkFromJson.getLeafCertificate());
    }
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.