@inrupt/solid-client / profile/jwks

Module: profile/jwks#

Functions#

addJwkToJwks#

addJwkToJwks(jwk, jwksIri, options?): Promise<Jwks>

Fetch a JWKS at a given IRI, and add the given JWK to the obtained key set.

Parameters#

Name

Type

Description

jwk

Jwk

The JWK to add to the set.

jwksIri

string

The IRI where the key set should be looked up.

options?

Object

options.fetch?

(input: RequestInfo | URL, init?: RequestInit) => Promise<Response>

MDN Reference

Returns#

Promise<Jwks>

Promise resolving to a JWKS where the given key has been added.

Since

1.12.0

Defined in#

src/profile/jwks.ts:111


addPublicKeyToProfileJwks#

addPublicKeyToProfileJwks(publicKey, webId, options?): Promise<Blob & WithResourceInfo>

Adds a public key to the JWKS listed in the profile associated to the given WebID. Retrieves the profile document for the specified WebID and looks up the associated JWKS. Having added the given key to the JWKS, this function overwrites the previous JWKS so that the new version is saved. This assumes the JWKS is hosted at a read-write IRI, such as in a Solid Pod.

Parameters#

Name

Type

Description

publicKey

Jwk

The public key value to set.

webId

string

The WebID whose profile document references the key set to which we wish to add the specified public key.

options

Object

Optional parameter options.fetch: An alternative fetch function to make the HTTP request, compatible with the browser-native fetch API.

options.fetch?

(input: RequestInfo | URL, init?: RequestInit) => Promise<Response>

MDN Reference

Returns#

Promise<Blob & WithResourceInfo>

Since

1.12.0

Defined in#

src/profile/jwks.ts:151


getProfileJwksIri#

getProfileJwksIri(profileDocument, webId): UrlString | null

Look for a JWKS IRI optionally advertized from a profile document.

Parameters#

Name

Type

Description

profileDocument

Readonly<{}>

The profile document.

webId

string

The WebID featured in the profile document.

Returns#

UrlString | null

The JWKS IRI associated with the WebID, if any.

Since

1.12.0

Defined in#

src/profile/jwks.ts:88


setProfileJwks#

setProfileJwks<Dataset>(profileDocument, webId, jwksIri): Dataset

Set a JWKS IRI associated with a WebID in a profile document.

Type parameters#

Name

Type

Dataset

extends Readonly<{}>

Parameters#

Name

Type

Description

profileDocument

Dataset

The profile document dataset.

webId

string

The WebID associated with the profile document.

jwksIri

string | Url

The JWKS IRI to be set.

Returns#

Dataset

A modified copy of the profile document, with the JWKS IRI set.

Since

1.12.0

Defined in#

src/profile/jwks.ts:65