Skip to main content
This release is 3 versions behind 1.2.3 — 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
100%
Published
a week ago (1.2.0)
class Multikey

Represents a key owned by an actor according to FEP-521a: Representing actor's public keys.

Constructors

new
Multikey(
values: { id?: URL | null; controller?: ; publicKey?: CryptoKey | null; },
unnamed 1?: { documentLoader?: DocumentLoader; contextLoader?: DocumentLoader; },
)

Constructs a new instance of Multikey with the given values.

Properties

protected
readonly
_contextLoader: DocumentLoader | undefined
protected
readonly
_documentLoader: DocumentLoader | undefined
readonly
controllerId: URL | null

Similar to Multikey.getController, but returns its @id URL instead of the object itself.

readonly
id: URL | null
readonly
publicKey: CryptoKey | null

A Multibase-encoded value of a Multicodec prefix and the key.

Methods

[Symbol.for("nodejs.util.inspect.custom")](
_depth: number,
options: unknown,
inspect: (
value: unknown,
options: unknown,
) => string
,
): string
protected
_getCustomInspectProxy(): Record<string, unknown>
clone(
values?: { id?: URL | null; controller?: ; publicKey?: CryptoKey | null; },
options?: { documentLoader?: DocumentLoader; contextLoader?: DocumentLoader; },
): Multikey

Clones this instance, optionally updating it with the given values.

getController(options?: { documentLoader?: DocumentLoader; contextLoader?: DocumentLoader; suppressError?: boolean; }): Promise<>

An actor who owns this key.

toJsonLd(options?: { format?: "compact" | "expand"; contextLoader?: DocumentLoader; context?:
string
| Record<string, string>
| (string | Record<string, string>)[]
; }
): Promise<unknown>

Converts this object to a JSON-LD structure.

Static Properties

readonly
typeId: URL

The type URI of Multikey: https://w3id.org/security#Multikey.

Static Methods

fromJsonLd(
json: unknown,
options?: { documentLoader?: DocumentLoader; contextLoader?: DocumentLoader; },
): Promise<Multikey>

Converts a JSON-LD structure to an object of this type.

Add Package

deno add jsr:@fedify/fedify

Import symbol

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

---- OR ----

Import directly with a jsr specifier

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

Add Package

npx jsr add @fedify/fedify

Import symbol

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

Add Package

yarn dlx jsr add @fedify/fedify

Import symbol

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

Add Package

pnpm dlx jsr add @fedify/fedify

Import symbol

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

Add Package

bunx jsr add @fedify/fedify

Import symbol

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