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());
}