Function decryptForThisServer
- decryptForThisServer<S extends string>(
scope: (keyof ServerEncryptionScopes) | S,
text: string,
options: { nullIfInvalid: true } & DecryptOptions,
):
| (
S extends keyof ServerEncryptionScopes
? ServerEncryptionScopes[S]
: unknown
)
| nullType Parameters
- S extends string
Parameters
- scope: (keyof ServerEncryptionScopes) | S
Scope or audience for encryption. This must be unique for each Encrypt usage so users cannot reuse encrypted data for a different API/call
- text: string
Data to decrypt
- options: { nullIfInvalid: true } & DecryptOptions
Options for decryption
nullIfInvalid: true
If true, return null if the data is invalid (instead of throwing an error)
OptionalacceptRetired?: booleanOptionalnullIfInvalid?: booleanOptionalsecret?: string
Returns
| (
S extends keyof ServerEncryptionScopes
? ServerEncryptionScopes[S]
: unknown
)
| null - decryptForThisServer<S extends string>(
scope: (keyof ServerEncryptionScopes) | S,
text: string,
options?: DecryptOptions,
): S extends keyof ServerEncryptionScopes
? ServerEncryptionScopes[S]
: unknownDecrypt data encrypted using encryptForThisServer
Type Parameters
- S extends string
Parameters
- scope: (keyof ServerEncryptionScopes) | S
Scope or audience for encryption. This must be unique for each Encrypt usage so users cannot reuse encrypted data for a different API/call
- text: string
Data to decrypt
Optionaloptions: DecryptOptionsOptions for decryption
OptionalacceptRetired?: booleanOptionalnullIfInvalid?: booleanOptionalsecret?: string
Returns S extends keyof ServerEncryptionScopes ? ServerEncryptionScopes[S] : unknown
Decrypt data encrypted using encryptForThisServer