Sets an arbitrary claim (a.k.a. body) param, if a parameter has already been set for that key then this method will override it.
NOTE: If you pass a Java.Time.Date value, this library will convert that date value into the number of seconds since epoch
the key in the claim segment to write to
the value to assign
Generates the final JWT with the configuration parameters and key signatures as set.
Sets the value for standard "aud" parameter in the JWT's claim segment (Also known as the Body).
If this property has already been set, then this method will override it.
This is the same as calling claim("aud", "your value here")
;
the value to assign
Sets an arbitrary header param, if a parameter for that key is already set, then this method will override it.
they key for this parameter
the value to write over it
Sets the value for standard "jti" parameter in the JWT's claim segment (Also known as the Body).
If this property has already been set, then this method will override it.
This is the same as calling claim("jti", "your value here")
;
the value to assign
Sets the value for standard "iat" parameter in the JWT's claim segment (Also known as the Body).
If this property has already been set, then this method will override it.
This is the same as calling claim("iat", "your value here")
;
NOTE: While it may seem confusing to pass a Java.Time.Date object, the library automatically converts that value into a number representing that date value as the number of seconds since epoch
the value to assign
Sets the value for standard "iss" parameter in the JWT's claim segment (Also known as the Body). If this property has already been set, then this method will override it. This is the same as calling `claim("iss", "your value here");
the value to assign
Sets the value for standard "nbf" parameter in the JWT's claim segment (Also known as the Body).
If this property has already been set, then this method will override it.
This is the same as calling claim("nbf", "your value here")
;
the value to assign
Sets the value for standard "sub" parameter in the JWT's claim segment (Also known as the Body).
If this property has already been set, then this method will override it.
This is the same as calling claim("sub", "your value here")
;
the value to assign
set the key with which you are going to sign this token
const pKey = B.crypto.createPrivateKeyFromPKCS8("RSA", privKey); const jwtBuilder = B.crypto.jwts.Jwts.builder(); const fullJsonWebToken = jwtBuilder .claim("key","value") .signWith(pKey) .compact(); // the compact method converts it to a string
NOTE: When you sign with a private key, this library will automatically overwrite
the header parameter "alg" with "RS512"
@param
See Java.Crypto.Jwts