@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.

Since

1.12.0

Parameters#

Name

Type

Default value

Description

jwk

Jwk

undefined

The JWK to add to the set.

jwksIri

string

undefined

The IRI where the key set should be looked up.

options

Partial<{ fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response> & (input: RequestInfo | URL, init?: RequestInit) => Promise<Response> }>

internal_defaultFetchOptions

Returns#

Promise<Jwks>

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

Defined in#

src/profile/jwks.ts:114


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.

Since

1.12.0

Parameters#

Name

Type

Default value

Description

publicKey

Jwk

undefined

The public key value to set.

webId

string

undefined

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

options

Partial<{ fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response> & (input: RequestInfo | URL, init?: RequestInit) => Promise<Response> }>

internal_defaultFetchOptions

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

Returns#

Promise<Blob & WithResourceInfo>

Defined in#

src/profile/jwks.ts:160


getProfileJwksIri#

getProfileJwksIri(profileDocument, webId): UrlString | null

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

Since

1.12.0

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.

Defined in#

src/profile/jwks.ts:91


setProfileJwks#

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

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

Since

1.12.0

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.

Defined in#

src/profile/jwks.ts:68