Skip to content

Documents for @litert/jwt / Algorithms/Eddsa / EddsaJwaSigner

Class: EddsaJwaSigner

Defined in: src/lib/Algorithms/Eddsa.ts:101

The signer using EdDSA algorithm, for JWT.

Example

ts
import * as LibJWT from '@litert/jwt';
const signer = new LibJWT.EddsaJwaSigner({
  privateKey: '-----BEGIN PRIVATE KEY-----\n...',
});
const token = await LibJWT.stringify({
  payload: { foo: 'bar' },
  signer: signer,
});
console.log(token);

Implements

Constructors

Constructor

new EddsaJwaSigner(opts): EddsaJwaSigner

Defined in: src/lib/Algorithms/Eddsa.ts:113

Parameters

opts

IEddsaSignerOptions

Returns

EddsaJwaSigner

Properties

digestType

readonly digestType: EDigestType

Defined in: src/lib/Algorithms/Eddsa.ts:109

The digest type to use for signing.

Implementation of

IJwaSigner.digestType


family

readonly family: ESigningAlgoFamily = cL.ESigningAlgoFamily.EDDSA

Defined in: src/lib/Algorithms/Eddsa.ts:103

The signing algorithm family.

Implementation of

IJwaSigner.family


jwa

readonly jwa: ESigningJwa = cL.ESigningJwa.EDDSA

Defined in: src/lib/Algorithms/Eddsa.ts:105

The signing algorithm to use, for the alg claim in the JWT header.

Implementation of

IJwaSigner.jwa


keyId?

readonly optional keyId: string | null

Defined in: src/lib/Algorithms/Eddsa.ts:107

The key ID to use in the JWT header.

Implementation of

IJwaSigner.keyId

Methods

sign()

sign(content): Buffer

Defined in: src/lib/Algorithms/Eddsa.ts:120

Sign the provided data and return the signature.

Parameters

content

string | Buffer<ArrayBufferLike>

Returns

Buffer

The signature.

Implementation of

IJwaSigner.sign