private void addRecord() {
        final long now = System.currentTimeMillis();
        final String uuid = UUID.randomUUID().toString();
        // We need to set up the jwkId so we know which JWTs were signed by which JWKs.
        final PublicJsonWebKey publicJsonWebKey = jsonWebKeyFactory.createPublicKey();
        final int typeId = keyTypeDao.getTypeId("JWK");

        LOGGER.debug(() -> LogUtil.message("Creating a {}", JSON_WEB_KEY.getName()));
        final JsonWebKeyRecord record = JSON_WEB_KEY.newRecord();
        record.setKeyId(uuid);
        record.setJson(jsonWebKeyFactory.asJson(publicJsonWebKey));
        record.setCreateTimeMs(now);
        record.setCreateUser("admin");
        record.setUpdateTimeMs(now);
        record.setUpdateUser("admin");
        record.setFkTokenTypeId(typeId);
        record.setEnabled(true);
        JooqUtil.create(identityDbConnProvider, record);
    }
This will always return a list of public keys creating them if needed.
stroom-security/stroom-security-identity-db/src/main/java/stroom/security/identity/db/JwkDaoImpl.java