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