Creates a new MessageVerifier instance with the provided secret
The secret key used for signing operations
Sign a given piece of value using the app secret. A wide range of data types are supported.
You can optionally define a purpose for which the value was signed and mentioning a different purpose/no purpose during unsign will fail.
The data to be signed
OptionalexpiresIn: string | numberOptional expiration time
Optionalpurpose: stringOptional purpose for which the value is signed
The signed payload as a string
Unsign a previously signed value with an optional purpose
The signed payload string to verify
Optionalpurpose: stringOptional purpose that the value was signed for
The original data if valid, null if invalid or verification fails
Message verifier is similar to the encryption. However, the actual payload is not encrypted and just base64 encoded. This is helpful when you are not concerned about the confidentiality of the data, but just want to make sure that is not tampered after encoding.