Function decryptForThisServer
- decryptForThisServer<S extends string>(
scope: (keyof ServerEncryptionScopes) | S,
text: string,
options: { nullIfInvalid: true },
):
| null
| (
S extends keyof ServerEncryptionScopes
? ServerEncryptionScopes[S<S>]
: unknown
)Type Parameters
- S extends string
Parameters
- scope: (keyof ServerEncryptionScopes) | S
Scope for encryption (must be unique for each Encrypt usage so you can't accidentally mix up calls)
- text: string
Data to decrypt
- options: { nullIfInvalid: true }
Options for decryption
nullIfInvalid: true
If true, return null if the data is invalid (instead of throwing an error)
Returns
| null
| (
S extends keyof ServerEncryptionScopes
? ServerEncryptionScopes[S<S>]
: unknown
) - decryptForThisServer<S extends string>(
scope: (keyof ServerEncryptionScopes) | S,
text: string,
options?: { nullIfInvalid?: boolean },
): S extends keyof ServerEncryptionScopes
? ServerEncryptionScopes[S<S>]
: unknownDecrypt data encrypted using encryptForThisServer
Type Parameters
- S extends string
Parameters
- scope: (keyof ServerEncryptionScopes) | S
Scope for encryption (must be unique for each Encrypt usage so you can't accidentally mix up calls)
- text: string
Data to decrypt
Optionaloptions: { nullIfInvalid?: boolean }Options for decryption
OptionalnullIfInvalid?: booleanIf true, return null if the data is invalid (instead of throwing an error)
Returns S extends keyof ServerEncryptionScopes ? ServerEncryptionScopes[S<S>] : unknown
Decrypt data encrypted using encryptForThisServer