Documents for @litert/jwt / Algorithms/Mldsa / MldsaJwaSigner
Class: MldsaJwaSigner
Defined in: src/lib/Algorithms/Mldsa.ts:103
The signer using ML-DSA algorithm, for JWT.
Example
import * as LibJWT from '@litert/jwt';
const signer = new LibJWT.MldsaJwaSigner({
privateKey: '-----BEGIN PRIVATE KEY-----\n...',
});
const token = await LibJWT.stringify({
payload: { foo: 'bar' },
signer: signer,
});
console.log(token);Implements
Constructors
Constructor
new MldsaJwaSigner(
opts):MldsaJwaSigner
Defined in: src/lib/Algorithms/Mldsa.ts:115
Parameters
opts
Returns
MldsaJwaSigner
Properties
digestType
readonlydigestType:EDigestType=cL.EDigestType.AUTO
Defined in: src/lib/Algorithms/Mldsa.ts:111
The digest type to use for signing.
Implementation of
family
readonlyfamily:ESigningAlgoFamily=cL.ESigningAlgoFamily.MLDSA
Defined in: src/lib/Algorithms/Mldsa.ts:105
The signing algorithm family.
Implementation of
jwa
readonlyjwa:ESigningJwa
Defined in: src/lib/Algorithms/Mldsa.ts:107
The signing algorithm to use, for the alg claim in the JWT header.
Implementation of
keyId?
readonlyoptionalkeyId:string|null
Defined in: src/lib/Algorithms/Mldsa.ts:109
The key ID to use in the JWT header.
Implementation of
Methods
sign()
sign(
content):Buffer
Defined in: src/lib/Algorithms/Mldsa.ts:122
Sign the provided data and return the signature.
Parameters
content
string | Buffer<ArrayBufferLike>
Returns
Buffer
The signature.