Ich bekomme auch den Vorschlag, "Argument für JWK" zu geben. Aber RSAKEY ist eine Klasse, die die abstrakte Klasse JWK erweitert, wenn Sie sich die Dokumentation https://github.com/felx/nimbus-jose-jwt ... rssey.jaVa & Java
Code: Select all
final List keys = Collections.singletonList(identityToRSAKey(certificate));
// Evidence the methold calls create the same type of output
List list = keys.stream().map(RSAKey::toPublicJWK).toList();
List collect = keys.stream().map(RSAKey::toPublicJWK).collect(Collectors.toList());
//This works
JWKSet mySet = new JWKSet(keys
.stream()
.map(RSAKey::toPublicJWK)
.collect(Collectors.toList()));
//This does not work
JWKSet mySet2 = new JWKSet(keys
.stream()
.map(RSAKey::toPublicJWK)
.toList() );
// Where we actually use the code
return new JWKSet(keys
.stream()
.map(RSAKey::toPublicJWK)
.collect(Collectors.toList() ))
.toPublicJWKSet()
.toJSONObject();
aufzurufen
Code: Select all
public JWKSet(List keys) {
this(keys, Collections.emptyMap());
}