EthSignJWT
@nevermined-io/sdk - v3.0.40 / EthSignJWT
Class: EthSignJWT
Hierarchy
SignJWT
↳
EthSignJWT
Table of contents
Constructors
Properties
Methods
- base64url
- concat
- ethSign
- setAudience
- setExpirationTime
- setIssuedAt
- setIssuer
- setJti
- setNotBefore
- setProtectedHeader
- setSubject
- sign
- signText
Constructors
constructor
• new EthSignJWT(payload
): EthSignJWT
Parameters
Name | Type | Description |
---|---|---|
payload | JWTPayload | The JWT Claims Set object. |
Returns
Inherited from
SignJWT.constructor
Defined in
node_modules/jose/dist/types/jwt/produce.d.ts:6
Properties
_payload
• Protected
_payload: JWTPayload
Inherited from
SignJWT._payload
Defined in
node_modules/jose/dist/types/jwt/produce.d.ts:4
protectedHeader
• protectedHeader: JWSHeaderParameters
Defined in
src/nevermined/utils/JwtUtils.ts:12
Methods
base64url
▸ base64url(input
): string
Parameters
Name | Type |
---|---|
input | string | Uint8Array |
Returns
string
Defined in
src/nevermined/utils/JwtUtils.ts:89
concat
▸ concat(...buffers
): Uint8Array
Parameters
Name | Type |
---|---|
...buffers | Uint8Array [] |
Returns
Uint8Array
Defined in
src/nevermined/utils/JwtUtils.ts:97
ethSign
▸ ethSign(signatureUtils
, account
, eip712Data?
): Promise
\<string
>
Parameters
Name | Type |
---|---|
signatureUtils | SignatureUtils |
account | NvmAccount |
eip712Data? | Eip712Data |
Returns
Promise
\<string
>
Defined in
src/nevermined/utils/JwtUtils.ts:19
setAudience
▸ setAudience(audience
): this
Set "aud" (Audience) Claim.
Parameters
Name | Type | Description |
---|---|---|
audience | string | string [] | "aud" (Audience) Claim value to set on the JWT Claims Set. |
Returns
this
Inherited from
SignJWT.setAudience
Defined in
node_modules/jose/dist/types/jwt/produce.d.ts:24
setExpirationTime
▸ setExpirationTime(input
): this
Set "exp" (Expiration Time) Claim.
Parameters
Name | Type | Description |
---|---|---|
input | string | number | "exp" (Expiration Time) Claim value to set on the JWT Claims Set. When number is passed that is used as a value, when string is passed it is resolved to a time span and added to the current timestamp. |
Returns
this
Inherited from
SignJWT.setExpirationTime
Defined in
node_modules/jose/dist/types/jwt/produce.d.ts:46
setIssuedAt
▸ setIssuedAt(input?
): this
Set "iat" (Issued At) Claim.
Parameters
Name | Type | Description |
---|---|---|
input? | number | "iat" (Issued At) Claim value to set on the JWT Claims Set. Default is current timestamp. |
Returns
this
Inherited from
SignJWT.setIssuedAt
Defined in
node_modules/jose/dist/types/jwt/produce.d.ts:53
setIssuer
▸ setIssuer(issuer
): this
Set "iss" (Issuer) Claim.
Parameters
Name | Type | Description |
---|---|---|
issuer | string | "Issuer" Claim value to set on the JWT Claims Set. |
Returns
this
Inherited from
SignJWT.setIssuer
Defined in
node_modules/jose/dist/types/jwt/produce.d.ts:12
setJti
▸ setJti(jwtId
): this
Set "jti" (JWT ID) Claim.
Parameters
Name | Type | Description |
---|---|---|
jwtId | string | "jti" (JWT ID) Claim value to set on the JWT Claims Set. |
Returns
this
Inherited from
SignJWT.setJti
Defined in
node_modules/jose/dist/types/jwt/produce.d.ts:30
setNotBefore
▸ setNotBefore(input
): this
Set "nbf" (Not Before) Claim.
Parameters
Name | Type | Description |
---|---|---|
input | string | number | "nbf" (Not Before) Claim value to set on the JWT Claims Set. When number is passed that is used as a value, when string is passed it is resolved to a time span and added to the current timestamp. |
Returns
this
Inherited from
SignJWT.setNotBefore
Defined in
node_modules/jose/dist/types/jwt/produce.d.ts:38
setProtectedHeader
▸ setProtectedHeader(protectedHeader
): EthSignJWT
Parameters
Name | Type |
---|---|
protectedHeader | JWSHeaderParameters |
Returns
Overrides
SignJWT.setProtectedHeader
Defined in
src/nevermined/utils/JwtUtils.ts:14
setSubject
▸ setSubject(subject
): this
Set "sub" (Subject) Claim.
Parameters
Name | Type | Description |
---|---|---|
subject | string | "sub" (Subject) Claim value to set on the JWT Claims Set. |
Returns
this
Inherited from
SignJWT.setSubject
Defined in
node_modules/jose/dist/types/jwt/produce.d.ts:18
sign
▸ sign(key
, options?
): Promise
\<string
>
Signs and returns the JWT.
Parameters
Name | Type | Description |
---|---|---|
key | Uint8Array | KeyLike | Private Key or Secret to sign the JWT with. See Algorithm Key Requirements. |
options? | SignOptions | JWT Sign options. |
Returns
Promise
\<string
>
Inherited from
SignJWT.sign
Defined in
node_modules/jose/dist/types/jwt/sign.d.ts:22
signText
▸ signText(text
, account
): Promise
\<undefined
| string
>
Parameters
Name | Type |
---|---|
text | string | Uint8Array |
account | Account |
Returns
Promise
\<undefined
| string
>