Skip to main content
Home
This release is 51 versions behind 1.9.1 — the latest version of @fedify/fedify. Jump to latest

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
7 months ago (1.5.0)
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.

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

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

pnpm i jsr:@fedify/fedify
or (using pnpm 10.8 or older)
pnpm dlx jsr add @fedify/fedify

Import symbol

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

Add Package

yarn add jsr:@fedify/fedify
or (using Yarn 4.8 or older)
yarn dlx jsr add @fedify/fedify

Import symbol

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

Add Package

vlt install jsr:@fedify/fedify

Import symbol

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

Add Package

npx 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";