findJsonWebKeys method

Stream<JsonWebKey?> findJsonWebKeys(
  1. JoseHeader header,
  2. String operation
)

Find JsonWebKeys for a JoseObject with header header.

See also https://tools.ietf.org/html/rfc7515#appendix-D

Implementation

Stream<JsonWebKey?> findJsonWebKeys(JoseHeader header, String operation) {
  if (header.algorithm == 'none') return Stream.fromIterable([null]);
  return _allKeys(header).where(
    (key) => _isValidKeyFor(key, header, operation),
  );
}