/** * This file is auto generated from JavaDoc. Do not modify it manually. */ import type { String } from "../../types/java/lang/String"; import type { Node } from "../../types/javax/jcr/Node"; /** * JSON Web Token (JWT) utilities. * *
* Technical information about JWT: *
* * @param* When creating a JWT token, Sitevision always adds an IAT (issued at) claim. The IAT date is set to the time of creation. * Custom claims can be of the following types. *
** JWT tokens signed using a pre-shared key can use an algorithm of the following types: *
** When creating a JWT token, Sitevision always adds an IAT (issued at) claim. The IAT date is set to the time of creation. * Custom claims can be of the following types. *
** JWT tokens signed using a pre-shared key can use an algorithm of the following types: *
** When signing or decoding JWT using RSA keypair, Sitevision only support keys coded in standard PEM text format. * Private keys can use password, but if a key without password is used, an empty string as password must be supplied. *
* @param aClaims The claims to send as payload. Claim values can be of types String, Boolean, Integer, Long and also arrays of Strings or Longs * @param aAlgorithm Signing algorithm used, viable values are RS256, RS384 and RS512 * @param aPrivateKey A sv:file or sv:temporaryFile with the PEM formatted RSA private key. * @param aPassword Password for the private key, use an empty string if the key is not password protected. * @return A JWT token * @throws ConstraintViolationException If the private key cannot be found or accessed * @throws JwtException If an error occurs when creating the JWT token * @throws IllegalArgumentException If aPassword is null, aAlgorithm is blank, aPrivateKey is null or if aPrivateKey is not a RSA private key. */ createRSAToken( aClaims: unknown, aAlgorithm: String | string, aPrivateKey: Node, aPassword: String | string ): string; /** * Validate a JWT token created with SHA and a pre-shared key. * ** The algorithm to decode is automatically detected by Sitevision from the token but it must be one of the following types: *
** The algorithm to decode is automatically detected by Sitevision from the token but it must be one of the following types: *
** When signing or decoding JWT using RSA keypair, Sitevision only support keys coded in standard PEM text format. *
* @param aToken Token to validate. * @param aPublicKey A sv:file or sv:temporaryFile containing the PEM formatted RSA public key for decrypting the JWT token. * @return A javascript object with the alg and payload if the token was correctly validated. * @throws ConstraintViolationException If the public key cannot be found or accessed * @throws JwtException If an error occurs the decoding the JWT token * @throws IllegalArgumentException If aToken is blank, aPublicKey is null or aPublicKey is not a RSA public key */ decodeRSA(aToken: String | string, aPublicKey: Node): unknown; } declare namespace JwtUtil {} declare var jwtUtil: JwtUtil; export default jwtUtil;