@Test void testLoadFile_InvalidKeyType_ThrowsKeyException() throws URISyntaxException, JwtBundleException { Path path = Paths.get(toUri("testdata/jwtbundle/jwks_invalid_keytype.json")); TrustDomain trustDomain = TrustDomain.of("domain.test"); try { JwtBundle.load(trustDomain, path); fail("should have thrown exception"); } catch (KeyException e) { assertEquals("Key Type not supported: OKP", e.getMessage()); } }
public static JwtBundle load(@NonNull final TrustDomain trustDomain, @NonNull final Path bundlePath) throws KeyException, JwtBundleException { try { val jwkSet = JWKSet.load(bundlePath.toFile()); return toJwtBundle(trustDomain, jwkSet); } catch (IOException | ParseException | JOSEException e) { val error = "Could not load bundle from file: %s"; throw new JwtBundleException(String.format(error, bundlePath.toString()), e); } }
JwtBundle implements BundleSource<JwtBundle> { public static JwtBundle load(@NonNull final TrustDomain trustDomain, @NonNull final Path bundlePath) throws KeyException, JwtBundleException { try { val jwkSet = JWKSet.load(bundlePath.toFile()); return toJwtBundle(trustDomain, jwkSet); } catch (IOException | ParseException | JOSEException e) { val error = "Could not load bundle from file: %s"; throw new JwtBundleException(String.format(error, bundlePath.toString()), e); } } }
JwtBundle implements BundleSource<JwtBundle> { public static JwtBundle load(@NonNull final TrustDomain trustDomain, @NonNull final Path bundlePath) throws KeyException, JwtBundleException { try { val jwkSet = JWKSet.load(bundlePath.toFile()); return toJwtBundle(trustDomain, jwkSet); } catch (IOException | ParseException | JOSEException e) { val error = "Could not load bundle from file: %s"; throw new JwtBundleException(String.format(error, bundlePath.toString()), e); } } JwtBundle(@NonNull final TrustDomain trustDomain);  JwtBundle(@NonNull final TrustDomain trustDomain, @NonNull final Map<String, PublicKey> jwtAuthorities); }
JwtBundle implements BundleSource<JwtBundle> { public static JwtBundle load(@NonNull final TrustDomain trustDomain, @NonNull final Path bundlePath) throws KeyException, JwtBundleException { try { val jwkSet = JWKSet.load(bundlePath.toFile()); return toJwtBundle(trustDomain, jwkSet); } catch (IOException | ParseException | JOSEException e) { val error = "Could not load bundle from file: %s"; throw new JwtBundleException(String.format(error, bundlePath.toString()), e); } } JwtBundle(@NonNull final TrustDomain trustDomain);  JwtBundle(@NonNull final TrustDomain trustDomain, @NonNull final Map<String, PublicKey> jwtAuthorities); static JwtBundle load(@NonNull final TrustDomain trustDomain, @NonNull final Path bundlePath); static JwtBundle parse(
            @NonNull final TrustDomain trustDomain,
            @NonNull final byte[] bundleBytes); @Override JwtBundle getBundleForTrustDomain(final TrustDomain trustDomain); Map<String, PublicKey> getJwtAuthorities(); PublicKey findJwtAuthority(final String keyId); boolean hasJwtAuthority(final String keyId); void putJwtAuthority(@NonNull final String keyId, @NonNull final PublicKey jwtAuthority); void removeJwtAuthority(final String keyId); }
JwtBundle implements BundleSource<JwtBundle> { public static JwtBundle load(@NonNull final TrustDomain trustDomain, @NonNull final Path bundlePath) throws KeyException, JwtBundleException { try { val jwkSet = JWKSet.load(bundlePath.toFile()); return toJwtBundle(trustDomain, jwkSet); } catch (IOException | ParseException | JOSEException e) { val error = "Could not load bundle from file: %s"; throw new JwtBundleException(String.format(error, bundlePath.toString()), e); } } JwtBundle(@NonNull final TrustDomain trustDomain);  JwtBundle(@NonNull final TrustDomain trustDomain, @NonNull final Map<String, PublicKey> jwtAuthorities); static JwtBundle load(@NonNull final TrustDomain trustDomain, @NonNull final Path bundlePath); static JwtBundle parse(
            @NonNull final TrustDomain trustDomain,
            @NonNull final byte[] bundleBytes); @Override JwtBundle getBundleForTrustDomain(final TrustDomain trustDomain); Map<String, PublicKey> getJwtAuthorities(); PublicKey findJwtAuthority(final String keyId); boolean hasJwtAuthority(final String keyId); void putJwtAuthority(@NonNull final String keyId, @NonNull final PublicKey jwtAuthority); void removeJwtAuthority(final String keyId);  }