Skip to main content

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.3.0)
class CryptographicKey

A key owned by an actor.

Constructors

new
CryptographicKey(
values: { id?: URL | null; owner?: ; publicKey?: CryptoKey | null; },
unnamed 1?: { documentLoader?: DocumentLoader; contextLoader?: DocumentLoader; tracerProvider?: TracerProvider; },
)

Constructs a new instance of CryptographicKey with the given values.

Properties

protected
writeonly
_cachedJsonLd: unknown | undefined
protected
readonly
_cachedJsonLd: unknown | undefined
protected
readonly
_contextLoader: DocumentLoader | undefined
protected
readonly
_documentLoader: DocumentLoader | undefined
protected
readonly
_tracerProvider: TracerProvider | undefined
readonly
id: URL | null
readonly
ownerId: URL | null

Similar to CryptographicKey.getOwner, but returns its @id URL instead of the object itself.

readonly
publicKey: CryptoKey | null

A PEM-encoded public 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; owner?: ; publicKey?: CryptoKey | null; },
options?: { documentLoader?: DocumentLoader; contextLoader?: DocumentLoader; },
): CryptographicKey

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

getOwner(options?: { documentLoader?: DocumentLoader; contextLoader?: DocumentLoader; suppressError?: boolean; tracerProvider?: TracerProvider; }): 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 CryptographicKey: https://w3id.org/security#Key.

Static Methods

protected
__fromJsonLd__CryptographicKey__(
json: unknown,
span: Span,
options?: { documentLoader?: DocumentLoader; contextLoader?: DocumentLoader; tracerProvider?: TracerProvider; },
): Promise<CryptographicKey>
fromJsonLd(
json: unknown,
options?: { documentLoader?: DocumentLoader; contextLoader?: DocumentLoader; tracerProvider?: TracerProvider; },
): Promise<CryptographicKey>

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

Add Package

deno add jsr:@fedify/fedify

Import symbol

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

---- OR ----

Import directly with a jsr specifier

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

Add Package

npx jsr add @fedify/fedify

Import symbol

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

Add Package

yarn dlx jsr add @fedify/fedify

Import symbol

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

Add Package

pnpm dlx jsr add @fedify/fedify

Import symbol

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

Add Package

bunx jsr add @fedify/fedify

Import symbol

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