public static JsonWebKey getJwkWithPublicKeyOnly ( JsonWebKey jwk ) { KeyPair publicOnly = jwk . toRSA ( false ) ; JsonWebKey jsonkeyPublic = JsonWebKey . fromRSA ( publicOnly ) ; jsonkeyPublic . withKid ( jwk . kid ( ) ) ; jsonkeyPublic . withKeyOps ( Arrays . asList ( JsonWebKeyOperation . ENCRYPT , JsonWebKeyOperation . WRAP_KEY , JsonWebKeyOperation . VERIFY ) ) ; return jsonkeyPublic ; }
Converts JsonWebKey with private key to JsonWebKey with public key only .