Function encryptForThisServer
- encryptForThisServer<S extends string>(
scope: S | (keyof ServerEncryptionScopes),
data: S extends keyof ServerEncryptionScopes
? ServerEncryptionScopes[S]
: unknown,
options?: AlgorithmOptions,
): stringType Parameters
- S extends string
Parameters
- scope: S | (keyof ServerEncryptionScopes)
Scope for encryption (must be unique for each Encrypt usage so you can't accidentally mix up calls)
- data: S extends keyof ServerEncryptionScopes ? ServerEncryptionScopes[S] : unknown
Data to sign and encrypt. Will be encoded as typed JSON if necessary
Optionaloptions: AlgorithmOptions
Returns string
Encrypted data, base64url encoded (so safe for direct use in URLs)
Encrypt data with this server's local key