Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.

public interface JwkSource

Known subtypesJwkSet, RemoteJwkSet

Where keys come from: a set held in memory, a file read at start-up, another server’s published set. What signs asks it for a private key; what verifies, for the public ones.

JwkSource keys = JwkSet.of(Jwk.ofPrivateKey(KeyFiles.readPrivateKey(path)));

A source is asked every time a key is needed, so one that changes its answer – a new key put first, the old one kept until its tokens have expired – rotates the key without anything being rebuilt.

Methods

public abstract List<Jwk> getKeys() throws IOExceptionThe keys, the one to sign with first.

Method details

getKeys

public abstract List<Jwk> getKeys() throws IOException
The keys, the one to sign with first.

Throws

IOException
when the keys cannot be had: a server that publishes them is not answering