Skip to main content
This release is 1 version behind 1.4.1 — the latest version of @fedify/fedify. Jump to latest

@fedify/fedify@1.4.0-dev.607+b9f34f48
Built and signed on GitHub Actions

An ActivityPub/fediverse server framework

This package works with Node.js, Deno, Bun
This package works with Node.js
This package works with Deno
This package works with Bun
JSR Score
94%
Published
3 weeks ago (1.4.0-dev.607+b9f34f48)
function fetchKey
fetchKey<T extends CryptographicKey | Multikey>(
keyId: URL | string,
cls: (new (...args: any[]) => T) & { fromJsonLd(
jsonLd: unknown,
options: { documentLoader?: DocumentLoader; contextLoader?: DocumentLoader; tracerProvider?: TracerProvider; },
): Promise<T>; }
,
options?: FetchKeyOptions,
): Promise<FetchKeyResult<T>>

Fetches a CryptographicKey or Multikey from the given URL. If the given URL contains an Actor object, it tries to find the corresponding key in the publicKey or assertionMethod property.

Type Parameters

The type of the key to fetch. Either CryptographicKey or Multikey.

Parameters

keyId: URL | string

The URL of the key.

cls: (new (...args: any[]) => T) & { fromJsonLd(
jsonLd: unknown,
options: { documentLoader?: DocumentLoader; contextLoader?: DocumentLoader; tracerProvider?: TracerProvider; },
): Promise<T>; }

The class of the key to fetch. Either CryptographicKey or Multikey.

optional
options: FetchKeyOptions

Options for fetching the key. See FetchKeyOptions.

Return Type

The fetched key or null if the key is not found.

Add Package

deno add jsr:@fedify/fedify

Import symbol

import { fetchKey } from "@fedify/fedify";

---- OR ----

Import directly with a jsr specifier

import { fetchKey } from "jsr:@fedify/fedify";

Add Package

npx jsr add @fedify/fedify

Import symbol

import { fetchKey } from "@fedify/fedify";

Add Package

yarn dlx jsr add @fedify/fedify

Import symbol

import { fetchKey } from "@fedify/fedify";

Add Package

pnpm dlx jsr add @fedify/fedify

Import symbol

import { fetchKey } from "@fedify/fedify";

Add Package

bunx jsr add @fedify/fedify

Import symbol

import { fetchKey } from "@fedify/fedify";