Get the salt as base64 string
Get a header string: Bearer sync-v1 ${authTokenB64}.
Pass in a token, or else this will use the authToken derived from
the main key.
OptionaltokenString: stringget a promise for the auth token.
Get the auth token as a base64 string
Decrypt in memory, not streaming.
Take an encrypted stream, return a decrypted stream.
The input (encrypted) stream
The decrypted stream
Returns an object containing ranges, an array of objects
containing offset and length integers specifying the encrypted byte
ranges that are needed to decrypt the client's specified range, and a
decrypt function.
Integer
Integer
Integer
Encrypt and return some data; don't stream.
NOTE: This generates a new key each time it is called, via
this.generateKey.
Optionalopts: { iv?: Uint8Array<ArrayBufferLike>; size?: number }Optional params,
iv and size. If size is omitted, default is 16 bytes. iv is
a random 12 bits, will be generated if not passed in.
Derive a new AES-GCM key from the main key.
OptionalkeyLength: numberOptional size for the key, in bytes, eg,
16 or 32.
Set the auth token
OptionalauthToken: string | Uint8Array<ArrayBufferLike>The new token
StaticAuthGet an authentication header as a static method.
StaticHeader
Get the main key as a
base64urlencoded string