HttpsJwks jwks = new HttpsJwks(confService.getJWKSEndpoint()); HttpsJwksVerificationKeyResolver resolver = new HttpsJwksVerificationKeyResolver(jwks);
public List<JsonWebKey> selectList(JsonWebEncryption jwe, Collection<JsonWebKey> keys) throws JoseException { SimpleJwkFilter filter = SelectorSupport.filterForInboundEncrypted(jwe); return filter.filter(keys); } }
public static SimpleJwkFilter filterForInboundSigned(JsonWebSignature jws) throws JoseException { SimpleJwkFilter filter = commonFilterForInbound(jws); filter.setUse(Use.SIGNATURE, SimpleJwkFilter.OMITTED_OKAY); filter.setKeyOperations(VERIFY_OPS, SimpleJwkFilter.OMITTED_OKAY); return filter; }
public static JsonWebKey newJwk(Map<String,Object> params) throws JoseException { String kty = getStringRequired(params, KEY_TYPE_PARAMETER); switch (kty) { case RsaJsonWebKey.KEY_TYPE: return new RsaJsonWebKey(params); case EllipticCurveJsonWebKey.KEY_TYPE: return new EllipticCurveJsonWebKey(params); case OctetSequenceJsonWebKey.KEY_TYPE: return new OctetSequenceJsonWebKey(params); default: throw new JoseException("Unknown key type algorithm: '" + kty + "'"); } }
@Override public Key getKey() { return key.getKey(); } }
public static PublicJsonWebKey newPublicJwk(Map<String,Object> params) throws JoseException { return newPublicJwk(params, null); }
public static PublicJsonWebKey newPublicJwk(Key publicKey) throws JoseException { JsonWebKey jsonWebKey = JsonWebKey.Factory.newJwk(publicKey); return (PublicJsonWebKey) jsonWebKey; }
public static PublicJsonWebKey newPublicJwk(Map<String,Object> params, String jcaProvider) throws JoseException { String kty = getStringRequired(params, KEY_TYPE_PARAMETER); switch (kty) { case RsaJsonWebKey.KEY_TYPE: return new RsaJsonWebKey(params, jcaProvider); case EllipticCurveJsonWebKey.KEY_TYPE: return new EllipticCurveJsonWebKey(params, jcaProvider); default: throw new JoseException("Unknown key type (for public keys): '" + kty + "'"); } }
String getCrv(JsonWebKey jwk) { try { return ((EllipticCurveJsonWebKey) jwk).getCurveName(); } catch (ClassCastException e) { return null; } }
private JsonWebKey select(JsonWebSignature jws, List<JsonWebKey> jsonWebKeys) throws JoseException { if (disambiguateWithVerifySignature) { return verificationJwkSelector.selectWithVerifySignatureDisambiguate(jws, jsonWebKeys); } else { return verificationJwkSelector.select(jws, jsonWebKeys); } }
public void setUse(String expectedUse, boolean omittedValueAcceptable) { use = new Criteria(expectedUse, omittedValueAcceptable); }
public void setCertificateChain(List<X509Certificate> certificateChain) { checkForBareKeyCertMismatch(); this.certificateChain = certificateChain; }
/** * @deprecated deprecated in favor of the more consistently named {@link #getRsaPublicKey()} */ public RSAPublicKey getRSAPublicKey() { return getRsaPublicKey(); }
public void setKeyOperations(String[] expectedKeyOps, boolean omittedValueAcceptable) { keyOps = new KeyOpsCriteria(expectedKeyOps, omittedValueAcceptable); }
public String getX509CertificateSha256Thumbprint() { return getX509CertificateSha256Thumbprint(false); }
public String toJson() { return toJson(OutputControlLevel.INCLUDE_SYMMETRIC); }
public static SimpleJwkFilter filterForInboundEncrypted(JsonWebEncryption jwe) throws JoseException { SimpleJwkFilter filter = commonFilterForInbound(jwe); filter.setUse(Use.ENCRYPTION, SimpleJwkFilter.OMITTED_OKAY); filter.setKeyOperations(DECRYPT_OPS, SimpleJwkFilter.OMITTED_OKAY); return filter; }
public static PublicJsonWebKey newPublicJwk(String json) throws JoseException { return newPublicJwk(json, null); }
public void setX5t(String expectedThumb, boolean omittedValueAcceptable) { x5t = new Criteria(expectedThumb, omittedValueAcceptable); }
public void setKty(String expectedKty) { kty = new Criteria(expectedKty, false); }