Skip to content

Documents for @litert/jwt / Algorithms/Mldsa / MldsaJwaVerifier

Class: MldsaJwaVerifier ​

Defined in: src/lib/Algorithms/Mldsa.ts:181

The signature validator using ML-DSA algorithm, for JWT.

Example ​

ts
import * as LibJWT from '@litert/jwt';
const verifier = new LibJWT.MldsaJwaVerifier({
  publicKey: '-----BEGIN PUBLIC KEY-----\n...',
});
const result = await LibJWT.parse({
  token: '...',
  verifier: verifier,
});
console.log(result);

Implements ​

Constructors ​

Constructor ​

new MldsaJwaVerifier(opts): MldsaJwaVerifier

Defined in: src/lib/Algorithms/Mldsa.ts:207

Parameters ​

opts ​

IMldsaValidatorOptions

Returns ​

MldsaJwaVerifier

Properties ​

checkAlgClaim ​

checkAlgClaim: boolean

Defined in: src/lib/Algorithms/Mldsa.ts:200

Whether to check the alg claim in the JWT header if it is present.


digestType ​

readonly digestType: EDigestType = cL.EDigestType.AUTO

Defined in: src/lib/Algorithms/Mldsa.ts:205

The digest type to use for verification.


family ​

readonly family: ESigningAlgoFamily = cL.ESigningAlgoFamily.MLDSA

Defined in: src/lib/Algorithms/Mldsa.ts:188

The signing algorithm family.


jwa ​

readonly jwa: ESigningJwa

Defined in: src/lib/Algorithms/Mldsa.ts:193

The JWA algorithm name.


name ​

readonly name: string

Defined in: src/lib/Algorithms/Mldsa.ts:183

The name of the validator.

When using with the JwtVerifier class, this name can be used to identify which validator failed.

Implementation of ​

IJwtValidator.name

Methods ​

validate() ​

validate(data): void

Defined in: src/lib/Algorithms/Mldsa.ts:219

Validate the provided parse result of a JWT, checking if the JWT is valid.

Parameters ​

data ​

IJwtParseResult

Returns ​

void

Throws ​

If validation failed or an error occurred inside.

Implementation of ​

IJwtValidator.validate